Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save joe-dempsey/e6f6bf021ac6e40eafa7e9ac07359f15 to your computer and use it in GitHub Desktop.
Save joe-dempsey/e6f6bf021ac6e40eafa7e9ac07359f15 to your computer and use it in GitHub Desktop.
tags filter shopify new - group tags
{% comment %} filters by style {% endcomment %}
{% assign tags = section.settings.tags_4 | split: ',' %}
{% assign show-filter = false %}
{% for tag in tags %}
{% if collection.all_tags contains tag %}
{% assign show-filter = true %}
{% endif %}
{% endfor %}
{% if show-filter %}
<h2>Filter by Style</h2>
<ul class="subnav clearfix listitems autosort">
{% for tag in tags %}
{% if current_tags contains tag %}
<li class="current">{{ tag | link_to_remove_tag: tag }}</li>
{% elsif collection.all_tags contains tag %}
<li>{{ tag | link_to_add_tag: tag }}</li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment