How to show all {{tags}} within {{#post}}

I have code like this inside post.hbs within {{#post}}:

{{#post}}
             ...
                    <ul>
                        {{#each tags}}
                            <li><a href="/tag/{{name}}">{{name}}</a></li>
                        {{/each}}
                    </ul>
             ...
{{/post}}

Output:

  • Getting Started

Output I want:

  • Getting Started
  • Test

Problem:
It’s only pulling the tags from that post.
I want to display all the tags known, not limited within the post.
I tried to do tags.all, but that doesn’t return anything.

Does it help?

{{#get 'tags' limit='all' include='count.posts' order='count.posts desc'}}
  {{#foreach tags}}
     <li><a href="/tag/{{name}}">{{name}}</a></li>
  {{/foreach}}
{{/get}}

Honestly, I haven’t tried this code. It comes from this article.

Thank you so much it works!

1 Like