Shopify : The current tag as a title

tag-title

Using tags in Shopify to create nested navigation is a great  way to help customers find products but once they’ve browsed to the tag page you need to let your customers  know what they’re looking at. A collection has the following property for this : -

{{ product.title }}

That works well for collections but tags are slightly different firstly a tag doesn’t have a title so you can’t have{{ tag.title }}. Tags are attributes of products and collections but if you use {{ collection.tags }} you are going to get a list of all the tags associated with the collection, which is not what we want. The function to use is : -

{{ current_tags }}

And voila this will output the current tag which you can use as a title by wrapping it in some <h2> tags or what ever you want. Nice and simple when you know how.

This entry was posted in Tutorials and tagged . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

One Comment

  1. Posted June 21, 2011 at 5:10 pm | Permalink

    Hi, Im currently building a site for a friend in shopify, however Im struggling to create a suitable navigation, as I can only have a collection with 1 set of products within the collection, how do I have sub categories ?

    an example would be,

    LAPTOPS

    Brands …

    Dell – Mac – HP – Acer – Sony

    Sub Categories —

    Harddrives – Accessories – Screens – Keyboard – Mouse – Other etc..

    Then I would have relative products inside each sub category.

    But this is hard to do in shopify ? Is there a way of passing a {{‘ GET product tags ‘}} or something like that in order to trigger the page to display relative products ?

    Help appreciated thanks.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>