The current_tags object

Product tags are used to filter a collection to only show products that contain a specific product tag. Similarly, article tags are used to filter a blog to only show products that contain a specific article tag. The current_tags variable is an array that contains all tags that are being used to filter a collection or blog.

Inside collection.liquid

Inside collection.liquid, current_tags contains all product tags that are used to filter a collection.

The example below creates a list that displays every tag within every product in a collection. If the collection is filtered by the tag (i.e. if current_tags does contain the tag), the link will remove the filter. If the collection is not currently filtered by the tag (if current_tags does not contain the tag), a link will appear to allow the user to do so.

Inside blog.liquid

Inside blog.liquid, current_tags contains all article tags that are used to filter the blog.

The example below adds a breadcrumb that shows which article tag is being used to filter a blog. If there is a tag being used to filter a blog, the breadcrumb displays the tag name and provides a link back to the unfiltered blog.