home.html.twig 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. {% extends 'partials/base.html.twig' %}
  2. {% set show_onpage_menu = header.onpage_menu == true or header.onpage_menu is null %}
  3. {% set cc = taxonomy.findTaxonomy({'category':'sous-menu'}) %}
  4. {% macro pageLinkName(text) %}{{ text|lower|replace({'01._':'','02._':'','03._':'','04._':'','05._':'','06._':'','07._':'','08._':'','09._':''}) }}{% endmacro %}
  5. {% block javascripts %}
  6. {% if show_onpage_menu %}
  7. {% endif %}
  8. {{ parent() }}
  9. {% endblock %}
  10. {% block header_navigation %}
  11. {% if show_onpage_menu %}
  12. <ul class="navigation">
  13. {% for module in page.collection() %}
  14. <li class="{{module.header.body_classes}}">
  15. <a href="#{{ _self.pageLinkName(module.folder) }}">{{ module.menu }}</a>
  16. {% for child in module.collection %}
  17. {% if child in cc %}
  18. <ol>
  19. <a href="#{{ _self.pageLinkName(child.folder) }}">{{ child.menu }}</a>
  20. </ol>
  21. {% endif %}
  22. {% endfor %}
  23. </li>
  24. {% endfor %}
  25. </ul>
  26. {% else %}
  27. {{ parent() }}
  28. {% endif %}
  29. {% endblock %}
  30. {% block content %}
  31. {{ page.content }}
  32. {% for module in page.collection() %}
  33. <div id="{{ _self.pageLinkName(module.folder) }}" class="column ">
  34. {{ module.content }}
  35. </div>
  36. {% endfor %}
  37. {% endblock %}