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

Highlighted
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
Highlighted
Astronaut
1890 1 416

Try this:

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

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

1 Like
Highlighted
Shopify Partner
65 0 6

Works like a charm Alex, thanks a lot!

0 Likes
Highlighted
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