Skip to content

Instantly share code, notes, and snippets.

@zachharkey
Created August 15, 2013 04:11
Show Gist options
  • Save zachharkey/6238204 to your computer and use it in GitHub Desktop.
Save zachharkey/6238204 to your computer and use it in GitHub Desktop.
<nav role="navigation">
<ul>
{% for link in linklists.main-menu.links %}
{% assign child_list_handle = link.title | handle %}
{% if linklists[child_list_handle] and linklists[child_list_handle].links.size > 0 %}
<li class="has-dropdown">
{{ link.title | link_to: link.url }}
<ul>
{% for child_link in linklists[child_list_handle].links %}
{% assign grand_child_list_handle = child_link.title | handle %}
{% if linklists[grand_child_list_handle] and linklists[grand_child_list_handle].links.size > 0 %}
<li class="has-dropdown">
{{ child_link.title | link_to: child_link.url }}
<ul>
{% for grand_child_link in linklists[grand_child_list_handle].links %}
<li>
{{ grand_child_link.title | link_to: grand_child_link.url }}
</li>
{% endfor %}
</ul>
</li>
{% else %}
<li>
{{ child_link.title | link_to: child_link.url }}
</li>
{% endif %}
{% endfor %}
</ul>
</li>
{% else %}
<li>
{{ link.title | link_to: link.url }}
</li>
{% endif %}
{% endfor %}
</ul>
</nav>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment