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.
Did you know?
Tags inside the current_tags array will always display in alphabetical order. It is not possible to manually change the order.
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.
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.