Created
September 1, 2013 05:16
-
-
Save zakhardage/6402487 to your computer and use it in GitHub Desktop.
This is an example of displaying breadcrumbs for products within a sub-collection in Shopify.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I am trying to create 2 levels down. How to I get grandparent url when I'm at second level?
Here's my code,
{% for link in linklists.main-menu.links %}
{% assign cur_parent = link.handle %}
{% assign cur_parent_title = link.title %}
{% assign cur_parent_url = link.url %}
{% if linklists[cur_parent].links.size > 0 %}
{% for link in linklists.[cur_parent].links %}
{% assign cur_parent_2 = link.handle %}
{% assign cur_parent_title_2 = link.title %}
{% assign cur_parent_url_2 = link.url %}
{% endif %}
{% endfor %}
{% if parent.size > 0 %}› {{ parent }} › {{ collection.title }} {% else %}› {{ collection.title }}{% endif %}
{% if parent_2.size > 0 %}› {{ parent_2 }} › {{ collection.title }}{% endif %}