forked from Mikescops/ModdernFolio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_sub_menu.twig
23 lines (20 loc) · 1.11 KB
/
_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
{% for item in menu %}
<li class="{% if item.submenu is defined %}has-dropdown{% else %} index-{{ loop.index }}{% if loop.first %} first{% endif %}{% if loop.last %} last{% endif %}{% if item|current %} active{% endif %}{% endif %}">
<a href="{% if item.submenu is defined %}#{% else %}{{ item.link }}{% endif %}" {% if item.title is defined %}title='{{ item.title|escape }}'{% endif %}
class='{% if item.submenu is defined %}dropdown-toggle{% else %}{% if item.class is defined %}{{item.class}}{% endif %}{% endif %}' {% if item.submenu is defined %}data-toggle="dropdown"{% endif %}>
{{item.label}}
</a>
{% if item.submenu is defined %}
<ul class="dropdown">
{% for item in item.submenu %}
<li>
<a href="{{ item.link }}" {% if item.title is defined %}title='{{ item.title|escape }}'{% endif %}>
{{item.label}}
</a>
</li>
{% endfor %}
</ul>
{% endif %}
</li>
<li class="divider"></li>
{% endfor %}