modular.html.twig 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. {% extends 'partials/base.html.twig' %}
  2. {% set show_onpage_menu = header.onpage_menu == true or header.onpage_menu is null %}
  3. {% macro pageLinkName(text) %}{{ text|lower|replace({' ':'_'}) }}{% endmacro %}
  4. {% block javascripts %}
  5. {% if show_onpage_menu %}
  6. {% do assets.add('theme://js/singlepagenav.min.js') %}
  7. {% endif %}
  8. {{ parent() }}
  9. {% endblock %}
  10. {% block bottom %}
  11. {{ parent() }}
  12. {% if show_onpage_menu %}
  13. <script>
  14. // singlePageNav initialization & configuration
  15. // $('ul.navigation').singlePageNav({
  16. // offset: $('#header').outerHeight(),
  17. // filter: ':not(.external)',
  18. // updateHash: true,
  19. // currentClass: 'active'
  20. // });
  21. </script>
  22. {% endif %}
  23. {% endblock %}
  24. {% block header_navigation %}
  25. {% if show_onpage_menu %}
  26. {% include 'partials/language-selector.html.twig' %}
  27. <ul class="navigation">
  28. {% for module in page.collection() %}
  29. {% set current_module = (module.active or module.activeChild) ? 'active' : '' %}
  30. <li><a class="{{ current_module }}" href="#{{ _self.pageLinkName(module.menu)|replace({"Í":"i" , "é":"e"}) }}">{{ module.menu|upper }}</a></li>
  31. {% endfor %}
  32. {% for mitem in site.menu %}
  33. <li>
  34. <a {% if mitem.class %}class="{{ mitem.class }}"{% endif %} href="{{ mitem.url }}">
  35. {% if mitem.icon %}<i class="fa fa-{{ mitem.icon }}"></i>{% endif %}
  36. {{ mitem.text }}
  37. </a>
  38. </li>
  39. {% endfor %}
  40. </ul>
  41. <ul class="nav_media_q">
  42. <button class="hamburger hamburger--squeeze" type="button">
  43. <span class="hamburger-box">
  44. <span class="hamburger-inner"></span>
  45. </span>
  46. </button>
  47. <div class="catbox">
  48. <div class="catlist">
  49. {% include 'partials/language-selector.html.twig' %}
  50. {% for module in page.collection() %}
  51. {% set current_module = (module.active or module.activeChild) ? 'active' : '' %}
  52. <li><a class="{{ current_module }}" href="#{{ _self.pageLinkName(module.menu)|replace({"Í":"i" , "é":"e"}) }}">{{ module.menu|upper }}</a></li>
  53. {% endfor %}
  54. {% for mitem in site.menu %}
  55. <li>
  56. <a {% if mitem.class %}class="{{ mitem.class }}"{% endif %} href="{{ mitem.url }}">
  57. {% if mitem.icon %}<i class="fa fa-{{ mitem.icon }}"></i>{% endif %}
  58. {{ mitem.text }}
  59. </a>
  60. </li>
  61. {% endfor %}
  62. </div>
  63. </div>
  64. </ul>
  65. {% else %}
  66. {{ parent() }}
  67. {% endif %}
  68. {% endblock %}
  69. {% block body %}
  70. <div id="{{ _self.pageLinkName(page.menu) }}" class="section">
  71. <div class="title">
  72. <div class="visu-album">
  73. {% set header_image_media = page.media.images|first %}
  74. {{header_image_media}}
  75. </div>
  76. {{page.content}}
  77. <div class="reso">
  78. </div>
  79. </div>
  80. </div>
  81. {% for module in page.collection() %}
  82. <div id="{{ _self.pageLinkName(module.title)|replace({"Í":"i" , "é":"e"})}}" class="section">
  83. {{ module.content }}
  84. </div>
  85. {% endfor %}
  86. {% endblock %}