Reputation: 81
I've set up sub-collections structure via Shopify menu's. This is what it looks like:
- Parent 1
-- Child 1
-- Child 2
--- Grandchild 1
--- Grandchild 2
-- Child 3
--- Grandchild 3
- Parent 2
- Parent 3
What I need is to only show the menu items one level lower. So for example:
What's the best way to make this work?
Upvotes: 0
Views: 845
Reputation: 78
{% for link in linklists.categories.links %} {% if link.url == collection.url and link.links != blank %} <ul>
{% for child_link in link.links %}
<li><a href= "{{ child_link.url }}">{{ child_link.title }}</a></li>
{% endfor %}</ul>{% else if link.links != blank %}{% for child_link in link.links %}{% if child_link.url == collection.url and child_link.links != blank %}
<ul>{% for grandchild_link in child_link.links %}
<li><a href= "{{ grandchild_link.url }}">{{ grandchild_link.title }}</a></li>
{% endfor %} </ul>
{% endif %} {% endfor %} {% endif %} {% endfor %}
Upvotes: 1