-
Notifications
You must be signed in to change notification settings - Fork 1
/
_sub_menu.twig
21 lines (20 loc) · 886 Bytes
/
_sub_menu.twig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{% macro display_menu_item(item, loop) %}
<li class="index-{{ loop.index }}{% if loop.first %} first{% endif %}{% if loop.last %} last{% endif %}{% if item.submenu is defined %} has-dropdown{% endif %}{% if item|current %} active{% endif %} menu-item menu-item-type-custom menu-item-object-custom">
<a href="{{ item.link }}" {% if item.title is defined %}title='{{ item.title|escape }}'{% endif %}
class='{% if item.class is defined %}{{item.class}}{% endif %}'>
{{item.label}}
</a>
{% if item.submenu is defined %}
<ul class="dropdown">
{% for submenu in item.submenu %}
{{ _self.display_menu_item(submenu, loop) }}
{% endfor %}
</ul>
{% endif %}
</li>
{% endmacro %}
{% for item in menu %}
{% if item.label is defined %}
{{ _self.display_menu_item(item, loop) }}
{% endif %}
{% endfor %}