Skip to content

Instantly share code, notes, and snippets.

@panoply
Created May 21, 2016 15:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save panoply/89ab8f21bae5e1d158ccffe990986106 to your computer and use it in GitHub Desktop.
Save panoply/89ab8f21bae5e1d158ccffe990986106 to your computer and use it in GitHub Desktop.
Sidebar Filter using Liquid for BRIXTOL.
<ul>
{% for tag in collection.tags %}
{% if
tag != 'Bomber'
and tag != 'Autumn / Winter'
and tag != 'Spring / Summer'
and tag != 'Coat'
and tag != 'Duffel'
and tag != 'Parka'
and tag != 'Sport Jacket'
and tag != 'Long Bomber'
and tag != 'Heritage'
and tag != 'Linen'
and tag != 'Shetland Wool'
and tag != 'Teddy Wool'
and tag != 'Waxed Cotton'
and tag != 'Sweater' %}
{% capture name %}{{ tag }}{% endcapture %}
{% unless name contains 'Color' %}
{% if current_tags contains tag %}
<li class="filter--active">
{{ tag | link_to_remove_tag: tag }}
</li>
{% else %}
<li>
{{ tag | link_to_add_tag: tag }}
</li>
{% endif %}
{% endunless %}
{% endif %}
{% endfor %}
</ul>
<ul>
{% for tag in collection.tags %}
{% if tag != 'Bomber'
and tag != 'Coat'
and tag != 'Duffel'
and tag != 'Parka'
and tag != 'Heritage'
and tag != 'Long Bomber'
and tag != 'Sport Jacket'
and tag != 'Men'
and tag != 'Women'
and tag != 'Unisex'
and tag != 'Linen'
and tag != 'Long Bomber'
and tag != 'Shetland Wool'
and tag != 'Teddy Wool'
and tag != 'Waxed Cotton'
and tag != 'Sweater' %}
{% capture name %}{{ tag }}{% endcapture %}
{% unless name contains 'Color' %}
{% if current_tags contains tag %}
<li class="filter--active">
{{ tag | link_to_remove_tag: tag }}
</li>
{% else %}
<li>
{{ tag | link_to_add_tag: tag }}
</li>
{% endif %}
{% endunless %}
{% endif %}
{% endfor %}
</ul>
<ul>
{% comment %}
And for the good stuff, loop through the tags themselves.
{% endcomment %}
{% for tag in collection.tags %}
{% if
tag != 'Autumn / Winter'
and tag != 'Spring / Summer'
and tag != 'Men'
and tag != 'Women'
and tag != 'Unisex'
and tag != 'Linen'
and tag != 'Shetland Wool'
and tag != 'Teddy Wool'
and tag != 'Waxed Cotton'
and tag != 'Sweater' %}
{% capture name %}{{ tag }}{% endcapture %}
{% unless name contains 'Color' %}
{% if current_tags contains tag %}
<li class="filter--active">
{{ tag | link_to_remove_tag: tag }}
</li>
{% else %}
<li>
{{ tag | link_to_add_tag: tag }}
</li>
{% endif %}
{% endunless %}
{% endif %}
{% endfor %}
</ul>
<ul>
{% for tag in collection.tags %}
{% if
tag != 'Bomber'
and tag != 'Long Bomber'
and tag != 'Coat'
and tag != 'Duffel'
and tag != 'Parka'
and tag != 'Heritage'
and tag != 'Sport Jacket'
and tag != 'Men'
and tag != 'Women'
and tag != 'Unisex'
and tag != 'Autumn / Winter'
and tag != 'Spring / Summer'
and tag != 'Sweater' %}
{% capture name %}{{ tag }}{% endcapture %}
{% unless name contains 'Color' %}
{% if current_tags contains tag %}
<li class="filter--active">
{{ tag | link_to_remove_tag: tag }}
</li>
{% else %}
<li>
{{ tag | link_to_add_tag: tag }}
</li>
{% endif %}
{% endunless %}
{% endif %}
{% endfor %}
</ul>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment