forked from Mikescops/Clean-Blog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_sub_menu.twig
24 lines (19 loc) · 1.15 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
24
{% for item in menu %}
<li class="{% if item.submenu is defined %}dropdown{% else %} index-{{ loop.index }}{% if loop.first %} first{% endif %}{% if loop.last %} last{% 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}} {% if item.submenu is defined %}<b class="caret"></b>{% endif %}
</a>
{% if item.submenu is defined %}
<ul class="dropdown-menu">
{% for item in item.submenu %}
<li class="{{ item.class }}">
<a href="{{ item.link }}" {% if item.title is defined %}title='{{ item.title|escape }}'{% endif %}>
{{item.label}}
</a>
</li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}