How to query all tags and display them

How to query all tags and display them or design a tab function to display all tabs.

1 Like

you can get all tags like this:

Query example:  "All page tags"
#+BEGIN_QUERY
{:title "All page tags"
:query [:find ?tag-name
      :where
      [?tag :page/name ?tag-name]]
:view (fn [tags]
      [:div
       (for [tag (flatten tags)]
         [:a.tag.mr-1 {:href (str "/page/" tag)}
          (str "#" tag)])])}
#+END_QUERY

More tips from logseq official document: Advanced Queries

3 Likes

Thanks, but this query looks up everything with # as a tag

1 Like

Hi, I am looking to use this query but to search only “#” tags that I have assigned (#shopping etc) not all pages / links, is that possible? @LittleDolphin

May be Tags Plugin is a good idea.

This is now possible simply with:
{{query (all-page-tags)}}