In a page, I have several tags, such as #1 #2 #3
I want to display all the tags in the working page.
or display at least the specific tags (e.g. #1) in the working page.
Anybody know how? thanks
In a page, I have several tags, such as #1 #2 #3
I want to display all the tags in the working page.
or display at least the specific tags (e.g. #1) in the working page.
Anybody know how? thanks
Hi,
This should work:
{{query (or [[tag 1]] [[tag 2]] [[tag 3]]) }}
thanks for your code.
But I want to query for tags in the working page, rather than the entire database. For example, a page includes sereral bolcks with property, and I want to put certain code in the page, to display all the blocks with property in this page.
Thank you all the same
the following advanced query should do this for you
#+BEGIN_QUERY
{:title "All tags in current page"
:query [:find (pull ?tag [*])
:in $ ?current-page
:where
[?cur :block/name ?current-page]
[?b :block/page ?cur]
[?b :block/refs ?tag]
]
:inputs [:current-page]
}
#+END_QUERY
hi,
above query works fine, and in my page, I have set page property with some tags there, and I want to query all tags but without those tags in the property, I run code as follow …
#+BEGIN_QUERY
{:title "all tags in current page excluding property tags"
:query [:find (pull ?tag [*])
:in $ ?current-page
:where
[?cur :block/name ?current-page]
[?b :block/page ?cur]
[?b :block/refs ?tag]
(not [?b :block/properties ?properties])
]
:inputs [:current-page]
:collapsed? true
}
#+END_QUERY
above code works only after I have to refresh logseq by Ctrl+R, otherwise it returns nothing.
I would like to know why?