Skip to content

Instantly share code, notes, and snippets.

@shopifypartners
Last active September 11, 2020 17:33
Case statement for collection template to build accessible breadcrumbs - https://www.shopify.com/partners/blog/breadcrumb-navigation
{% when 'collection' and collection.handle %}
{% if current_tags %}
<li>{{ collection.title | link_to: collection.url }}</li>
<li>
{% capture tag_url %}{{ collection.url }}/{{ current_tags | join: "+"}}{% endcapture %}
<a href="{{ tag_url }}" aria-current="page">{{ current_tags | join: " + "}}</a>
</li>
{% else %}
<li>
<a href="{{ collection.url }}" aria-current="page">{{ collection.title }}</a>
</li>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment