Making a template where all tags are listed and clickable

Hi, I am trying to make inline template. The goal is having a list with all available tags. I am running into 2 issues.

  1. I am unable to distinct the results, like in SQL.
  2. The page name go to a new (empty) page.

currently I am doing this:

```template
{{#each {tag}}}
 [[{{name}}]]
{{/each}}
`` 

Is this possible?

How about

{{#each {tag select name order by name}}}
  - #{{name}}
{{/each}}
``
3 Likes

It’s worth noting that query results are automatically deduplicated based on the attributes you select. So indeed, the query tag select name would give you a unique list of tag names. If you’d like to select only tags applied to pages, you can also use something like tag where parent = "page" select name

2 Likes

Perferct, exactly what I was looking for! Thanks for this and the great project.

Not sure if it applies to you but I also added a “Filter” for my page that is listing my tags:

  1. Add an attribute to the page called queryString [queryString: ""]
  2. Modify the query to be similar to:
{{#if queryString =~ /^\s?$/ }}
{{#each {tag select name order by name}}}
  - #{{name}}
{{/each}}
{{else}}
  {{#each {tag where name =~ @page.queryString select name order by name}}}
  - #{{name}}
{{/each}}
{{/if}}

I did it with this template, this way you can clic the tag an it shows you all the pages within that tag

{{#let @tags = {tag select name}}}
{{#each @tags}}#{{name}}|{{/each}}
{{/let}}

Great! Exact what I am looking for! But replace the “|” with a space, because it will screw up your row break.