Query Todos on Current Page

idk if i did right but with that modification got no results

#+BEGIN_QUERY
{
 :query [:find ?p-name  --> change
   :in $ ?current-name
   :where
[?p :block/name ?p-name]  --> add
     [?current :block/name ?current-name]
     (or-join [?name]
       [?current :block/name ?name]
       (and
         [?current :block/alias ?alias]
         [?alias :block/name ?name]
       )
     )
     (property ?p :-zoom ?name)
 ]
 :inputs [:current-page]
}
#+END_QUERY
  • Make these changes to your last effort:
    • Replace (property ?p :-zoom ?name) with (property ?b :-zoom ?name)
    • Then add [?b :block/page ?p]
  • By the way, when you want to comment, use ;
    • e.g.:
      • p-name ; add
      • p-name ; change
    • This way the query remains valid to run.

thanks it work, is possible to make it clickable as a link (like in the simple queries, that returns the name of the pages as a link), for me to click and go to the page ?
and really thanks for your support into this

Could either:

  • replace :find ?p-name with :find (pull ?p [:block/name])
  • add :view (fn [pages] [:div (for [p pages] [:div [:a {:href (str "#/page/" p) } p] ] ) ] )

By now we are off-topic.

1 Like

Bro, many thanks, the second one solved here !
May i ask where did you learn to be able to do these queries ?

sorry bro i though was working but then i test in other notes it keep giving the same result even in different pages

what i was trying to do is,
Note A
-zoom:: Note B

Note C
-zoom:: Note B/alias (instead of the title)

On note B i would like to have a query to know which notes linked to note B in the -zoom:: property
with the simple query i was able to get only the notes linked to note B title, but the ones linked to note B alias was not showing

gonna create a topic on the queries section to not be too much off topic