Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Webhook two-level menu
{% set top_menu = cms.navigation %}
<!-- Sidebar -->
<div id="sidebar-wrapper">
<ul class="sidebar-nav">
{#
<li id="menu-close" class="text-right">
<a href="#"><span class="fa fa-close"></span></a>
</li>
#}
{% for item in top_menu.menu_items %}
{% if item.children %}
<li><strong>
<a href="{{ url(item.parent) }}" role="button" aria-expanded="false">{{ item.parent.name }}
<span class="caret"></span></a></strong>
</li>
{% for subitem in item.children %}
<li class="li-indent">
<a href="{{ url(subitem.children) }}">{{ subitem.name }}</a>
</li>
{% endfor %}
{% else %}
<li>
<strong>
<a href="{{ url(item.parent) }}">
{{ item.parent.name }}
</a>
</strong>
</li>
{% endif %}
{% endfor %}
</ul>
</div><!-- /#sidebar-wrapper -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.