Skip to content

Instantly share code, notes, and snippets.

@Chrisedmo
Created July 31, 2012 11:38
Show Gist options
  • Save Chrisedmo/3216380 to your computer and use it in GitHub Desktop.
Save Chrisedmo/3216380 to your computer and use it in GitHub Desktop.
Shopify: Tags
<ul>
<li{% unless current_tags %} class="active"{% endunless %}>
{% if collection.handle %}
<a href="/collections/{{ collection.handle }}">All</a>
{% elsif collection.products.first.type == collection.title %}
<a href="{{ collection.title | url_for_type }}">All</a>
{% elsif collection.products.first.vendor == collection.title %}
<a href="{{ collection.title | url_for_vendor }}">All</a>
{% endif %}
</li>
{% for tag in collection.all_tags %}
{% if current_tags contains tag %}
<li class="active">
{{ tag | link_to_remove_tag: tag }}
</li>
{% else %}
<li>
{{ tag | link_to_add_tag: tag }}
</li>
{% endif %}
{% endfor %}
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment