mirror of
https://github.com/pmoreno-rodriguez/grav-theme-future2021.git
synced 2025-07-19 16:39:01 +00:00
69 lines
No EOL
2.2 KiB
Twig
69 lines
No EOL
2.2 KiB
Twig
{% block menu_navigation %}
|
|
{% macro loop(page) %}
|
|
{% for p in page.children %}
|
|
{% if p.visible %}
|
|
{% set current_page = (p.active or p.activeChild) ? 'active' : '' %}
|
|
<li class="{{ current_page }}">
|
|
{% if p.routable == false and p.children.count > 0%}
|
|
<a class="dropdown-btn">
|
|
{% if p.header.icon %}<i class="fa fa-{{ p.header.icon }}"></i>{% endif %}
|
|
<i class="fa fa-caret-down"></i>
|
|
<span>{{ p.menu }}</span>
|
|
</a>
|
|
<ul class="subitem_hide">
|
|
{{ _self.loop(p) }}
|
|
</ul>
|
|
{% elseif p.routable != false and p.children.count > 0 %}
|
|
<a>
|
|
{% if p.header.icon %}<i class="fa fa-{{ p.header.icon }}"></i>{% endif %}
|
|
<span>{{ p.menu }}</span>
|
|
</a>
|
|
<ul class="subitem">
|
|
{{ _self.loop(p) }}
|
|
</ul>
|
|
{% else %}
|
|
<a href="{{ p.url }}">
|
|
{% if p.header.icon %}<i class="fa fa-{{ p.header.icon }}"></i>{% endif %}
|
|
<span>{{ p.menu }}</span>
|
|
</a>
|
|
{% endif %}
|
|
</li>
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% endmacro %}
|
|
<ul class="menulink">
|
|
{% if theme_config.dropdown.enabled %}
|
|
{{ _self.loop(pages) }}
|
|
{% else %}
|
|
{% for p in pages.children.visible %}
|
|
{% set current_page = (p.active or p.activeChild) ? 'active' : '' %}
|
|
<li class="{{ current_page }}">
|
|
{% if p.routable == false and p.children.count > 0%}
|
|
<a>
|
|
{% if p.header.icon %}<i class="fa fa-{{ p.header.icon }}"></i>{% endif %}
|
|
<span>{{ p.menu }}</span>
|
|
</a>
|
|
{% elseif p.routable != false and p.children.count > 0 %}
|
|
<a>
|
|
{% if p.header.icon %}<i class="fa fa-{{ p.header.icon }}"></i>{% endif %}
|
|
<span>{{ p.menu }}</span>
|
|
</a>
|
|
{% else %}
|
|
<a href="{{ p.url }}">
|
|
{% if p.header.icon %}<i class="fa fa-{{ p.header.icon }}"></i>{% endif %}
|
|
<span>{{ p.menu }}</span>
|
|
</a>
|
|
{% endif %}
|
|
</li>
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% for mitem in site.menu %}
|
|
<li>
|
|
<a href="{{ mitem.url }}">
|
|
{% if mitem.icon %}<i class="fa fa-{{ mitem.icon }}"></i>{% endif %}
|
|
{{ mitem.text }}
|
|
</a>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endblock %} |