Display a list of all used blog tags on a page.

Leon_Templin
Shopify Partner
65 0 6

I want to have a page that lists all blog tags that have been used site wide. we only have one blog. When I try the snippets provided by shopify in a page template I get no results. I have tried this:

{% for tag in blog.tags %}
    <li><a href="{{ blog.url }}/tagged/{{ tag | handle }}">{{ tag }}</a></li>
{% endfor %}

I have also tried 

{% for tag in blog.all_tags %}

Both yeild no results even though there are around 30 tags. I think the issue may be that I am attempting this from a page template rather than from the blog template but I'm not sure. Does anyone know how to get a list of all blog tags and display them on a page template?

 

Thanks!

 

0 Likes
Alex135
Astronaut
1889 1 461

Try this:

{% for tag in blogs['BLOG-HANDLE'].all_tags %}

Of course, change "BLOG-HANDLE" appropriately.  I hope this helps.

Leon_Templin
Shopify Partner
65 0 6

Works like a charm Alex, thanks a lot!

0 Likes
Newbify
New Member
1 0 0

Is there more code needed than what you posted? 

Also, is the tag just what i put on each post?

0 Likes
andremar23
New Member
1 0 0

Is there a way to take all the blog tags in the store as its shown on shopify admin when you want to add a tag to the article? if i show the TAGS with the featured blogs the TAGS repeat becasue there are blogs with the same TAG .. I hope i explained myself well .. Thanks in advance! 

0 Likes