diff --git a/templates/modular.html.twig b/templates/modular.html.twig index 2d7d69c..90373db 100644 --- a/templates/modular.html.twig +++ b/templates/modular.html.twig @@ -1,50 +1,27 @@ {% extends 'partials/base.html.twig' %} -{% set show_onpage_menu = header.onpage_menu == true or header.onpage_menu is null %} {% macro pageLinkName(text) %}{{ text|lower|replace({' ':'_'}) }}{% endmacro %} {% block javascripts %} - {% if show_onpage_menu %} - {% do assets.add('theme://js/singlepagenav.min.js') %} - {% endif %} + {% do assets.add('theme://js/singlepagenav.min.js') %} + {{ parent() }} + {% endblock %} {% block bottom %} {{ parent() }} - {% if show_onpage_menu %} - - {% endif %} -{% endblock %} -{% block header_navigation %} - {% if show_onpage_menu %} - - {% else %} - {{ parent() }} - {% endif %} + + {% endblock %} {% block hero %} @@ -52,6 +29,7 @@
{{ module.content }} {% endfor %} + {% endblock %} {% block body %} @@ -59,4 +37,5 @@
{{ module.content }} {% endfor %} + {% endblock %} diff --git a/templates/partials/base.html.twig b/templates/partials/base.html.twig index 707965a..1687ec3 100644 --- a/templates/partials/base.html.twig +++ b/templates/partials/base.html.twig @@ -106,6 +106,7 @@ {% block bottom %} {{ assets.js('bottom') }} + {% endblock %} diff --git a/templates/partials/navigation.html.twig b/templates/partials/navigation.html.twig index d81eed6..5ac2ec4 100644 --- a/templates/partials/navigation.html.twig +++ b/templates/partials/navigation.html.twig @@ -1,6 +1,9 @@ +{% macro pageLinkName(text) %}{{ text|lower|replace({' ':'_'}) }}{% endmacro %} + {% macro nav_loop(page) %} {% for p in page.children.visible %} {% set active_page = (p.active or p.activeChild) ? 'active' : '' %} + {% set modules = p.collection() %} {% if p.children.visible.count > 0 %}
  • @@ -10,6 +13,22 @@ {{ _self.nav_loop(p) }}
  • + {% elseif modules.count > 0 %} +
  • + + {{ p.menu }} + + +
  • {% else %}