Created
March 6, 2018 16:22
-
-
Save joe-dempsey/e6f6bf021ac6e40eafa7e9ac07359f15 to your computer and use it in GitHub Desktop.
tags filter shopify new - group tags
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% 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