-
Notifications
You must be signed in to change notification settings - Fork 1
/
_sub_menu.twig
executable file
·24 lines (22 loc) · 1010 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
22
23
24
{% macro display_menu_item(item, loop) %}
{% from _self import display_menu_item %}
<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 %}">
<a href="{{ item.link }}" {% if item.title is defined %}title='{{ item.title|escape }}'{% endif %}
class='{% if item.class is defined %}{{item.class}}{% endif %}'>
{% if item.label is defined %}{{item.label}}{% else %} - {% endif %}
</a>
{% if item.submenu is defined %}
<ul class="dropdown">
{% for submenu in item.submenu %}
{{ display_menu_item(submenu, loop) }}
{% endfor %}
</ul>
{% endif %}
</li>
{% endmacro %}
{% from _self import display_menu_item %}
{% for item in menu %}
{% if item.label is defined %}
{{ display_menu_item(item, loop) }}
{% endif %}
{% endfor %}