diff options
author | sowgro <tpoke.ferrari@gmail.com> | 2023-10-16 15:16:55 -0400 |
---|---|---|
committer | sowgro <tpoke.ferrari@gmail.com> | 2023-10-16 15:16:55 -0400 |
commit | 753be9b8271a32a1b6319f1a7ee8ba2d63f138a9 (patch) | |
tree | 2582add260e1c27d0effc53de12023e07368c1a6 /templates/partials/navigation.html.twig | |
download | grav-sowtheme-753be9b8271a32a1b6319f1a7ee8ba2d63f138a9.tar.gz grav-sowtheme-753be9b8271a32a1b6319f1a7ee8ba2d63f138a9.tar.bz2 grav-sowtheme-753be9b8271a32a1b6319f1a7ee8ba2d63f138a9.zip |
first commit
Diffstat (limited to 'templates/partials/navigation.html.twig')
-rw-r--r-- | templates/partials/navigation.html.twig | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/templates/partials/navigation.html.twig b/templates/partials/navigation.html.twig new file mode 100644 index 0000000..28df6aa --- /dev/null +++ b/templates/partials/navigation.html.twig @@ -0,0 +1,47 @@ +{% macro loop(page) %} + {% for p in page.children.visible %} + {% set current_page = (p.active or p.activeChild) ? 'selected' : '' %} + {% if p.children.visible.count > 0 %} + <li class="has-children {{ current_page|e }}"> + <a href="{{ p.url|e }}"> + {% if p.header.icon %}<i class="fa fa-{{ p.header.icon|e }}"></i>{% endif %} + {{ p.menu|e }} + </a> + <ul> + {{ _self.loop(p) }} + </ul> + </li> + {% else %} + <li class="{{ current_page|e }}"> + <a href="{{ p.url|e }}"> + {% if p.header.icon %}<i class="fa fa-{{ p.header.icon|e }}"></i>{% endif %} + {{ p.menu|e }} + </a> + </li> + {% endif %} + {% endfor %} +{% endmacro %} + +<ul> + {% if config.theme.dropdown.enabled %} + {{ _self.loop(pages) }} + {% else %} + {% for page in pages.children.visible %} + {% set current_page = (page.active or page.activeChild) ? 'selected' : '' %} + <li class="{{ current_page|e }}"> + <a href="{{ page.url|e }}"> + {% if page.header.icon %}<i class="fa fa-{{ page.header.icon|e }}"></i>{% endif %} + {{ page.menu|e }} + </a> + </li> + {% endfor %} + {% endif %} + {% for mitem in site.menu %} + <li> + <a href="{{ mitem.url|e }}"> + {% if mitem.icon %}<i class="fa fa-{{ mitem.icon|e }}"></i>{% endif %} + {{ mitem.text|e }} + </a> + </li> + {% endfor %} +</ul> |