Liquid Template Variables - current tags

From Spiffy Stores Knowledge Base

Revision as of 11:20, 27 April 2016 by Admin (talk | contribs)

The current_tags of a collection are the tags that have been used to filter the current view of the collection.

current_tags is always returned as an array of tag values. If there aren't any tags, then an empty array is returned.

The array can be tested by

  {% unless current_tags == empty %}
    ...
  {% endunless %}

For example, with the URL:

/page /collections/hair_raising_stuff/lime+electric+unforgettable

In this case, current_tags will be ["lime", "electric", "unforgettable"].

There may be additional tags which can be accessed using collection.tags.