macros.html.twig 422 B

12345678910111213141516
  1. {% macro nav_loop(page) %}
  2. {% import _self as macros %}
  3. {% for p in page.children.visible %}
  4. {% set active_page = (p.active or p.activeChild) ? 'active' : '' %}
  5. <li>
  6. <a href="{{ p.url }}" class="{{ active_page }}">
  7. {{ p.menu }}
  8. </a>
  9. {% if p.children.visible.count > 0 %}
  10. <ul>
  11. {{ macros.nav_loop(p) }}
  12. </ul>
  13. {% endif %}
  14. </li>
  15. {% endfor %}
  16. {% endmacro %}