Skip to content

Instantly share code, notes, and snippets.

@anilmeena
Created October 15, 2016 16:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anilmeena/b56b562e2df3dd0942ea6e62381954ad to your computer and use it in GitHub Desktop.
Save anilmeena/b56b562e2df3dd0942ea6e62381954ad to your computer and use it in GitHub Desktop.
Multilevel Navigation Menu in Shopify
<ul class="horizontal unstyled clearfix">
{% for link in linklists.main-menu.links %}
{% if linklists[link.handle] == empty %}
<li>
<a href="{{ link.url }}" class="{% if link.active %} current{% endif %}">
<span>{{ link.title }}</span></a>
</li>
{% else %}
<!-- Menu level 1 -->
<li class="dropdown"><a href="{{ link.url }}" class="{% if link.active %} current{% endif %}">
<span>{{ link.title }}</span></a>
<ul class="dropdown">
{% for l in linklists[link.handle].links %}
<!-- Menu level 2 -->
<li class="dropdown"><a href="{{ l.url }}"{% if l.active %} class="current"{% endif %}>{{ l.title }}</a></li>
{% if linklists[l.handle] != empty %}
<ul class="dropdown">
{% for child_l in linklists[l.handle].links %}
<!-- Menu level 3 -->
<li><a href="{{ child_l.url }}"{% if child_l.active %} class="current"{% endif %}>{{ child_l.title }}</a></li>
{% endfor %}
</ul>
{% endif %}
{% endfor %}
</ul>
</li>
{% endif %}
{% endfor %}
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment