macros.html.twig 557 B

12345678910111213141516171819202122
  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) ? ' class="active"' : '' %}
  5. {% if p.children.visible.count > 0 %}
  6. <li>
  7. <a href="{{ p.url }}"{{ active_page }}>
  8. {{ p.menu }}
  9. </a>
  10. <ul>
  11. {{ macros.nav_loop(p) }}
  12. </ul>
  13. </li>
  14. {% else %}
  15. <li>
  16. <a href="{{ p.url }}"{{ active_page }}>
  17. {{ p.menu }}
  18. </a>
  19. </li>
  20. {% endif %}
  21. {% endfor %}
  22. {% endmacro %}