modular.html.twig 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. {% extends 'partials/base.html.twig' %}
  2. {% macro pageLinkName(text) %}{{ text|lower|replace({' ':'_'}) }}{% endmacro %}
  3. {% import _self as macro %}
  4. {% set show_onpage_menu = header.onpage_menu == true or header.onpage_menu is null %}
  5. {% block javascripts %}
  6. {% if show_onpage_menu %}
  7. {% do assets.add('theme://js/singlepagenav.min.js') %}
  8. {% endif %}
  9. {{ parent() }}
  10. {% endblock %}
  11. {% block bottom %}
  12. {{ parent() }}
  13. {% if show_onpage_menu %}
  14. <script>
  15. // singlePageNav initialization & configuration
  16. $('ul.navigation').singlePageNav({
  17. offset: $('#header').outerHeight(),
  18. filter: ':not(.external)',
  19. updateHash: true,
  20. currentClass: 'active'
  21. });
  22. </script>
  23. {% endif %}
  24. {% endblock %}
  25. {% block header_navigation %}
  26. {% if show_onpage_menu %}
  27. <ul class="navigation">
  28. {% for module in page.collection() if module.header.visible is not same as(false) %}
  29. {% set current_module = (module.active or module.activeChild) ? 'active' : '' %}
  30. <li><a class="{{ current_module }}" href="#{{ macro.pageLinkName(module.menu) }}">{{ module.menu }}</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. {% else %}
  42. {{ parent() }}
  43. {% endif %}
  44. {% endblock %}
  45. {% block hero %}
  46. {% for module in page.collection() if module.template == 'modular/hero' %}
  47. <div id="{{ macro.pageLinkName(module.menu) }}"></div>
  48. {{ module.content|raw }}
  49. {% endfor %}
  50. {% endblock %}
  51. {% block body %}
  52. <section id="{{ macro.pageLinkName(page.menu) }}">
  53. {{page.content}}
  54. </section>
  55. {% for module in page.collection() %}
  56. <section id="{{ macro.pageLinkName(module.menu) }}">
  57. <h2>{{ module.title }}</h2>
  58. <div class="filet"></div>
  59. {{ module.content|raw }}
  60. {% for child in module.collection %}
  61. {% set gal = child.header.blog.config %}
  62. <section id="{{ macro.pageLinkName(child.menu) }}">
  63. {% if child.title %}
  64. <div class="title">
  65. <h3>{{ child.title }}</h3>
  66. <div class="filet"></div>
  67. </div>
  68. {% endif %}
  69. {% if child.content %}
  70. <div class="content">
  71. {{ child.content }}
  72. </div>
  73. {% endif %}
  74. <div class="images">
  75. {% for images in child.media.images %}
  76. {{ images.html }}
  77. <div class="content">
  78. {{ child.content }}
  79. </div>
  80. {% endfor %}
  81. </div>
  82. {% if gal %}
  83. <div class="owl-carousel">
  84. {% for item in child.collection %}
  85. <div class="galerie">
  86. {% for images in item.media.images %}
  87. <div class="images">
  88. {{ images.html }}
  89. </div>
  90. {% endfor %}
  91. <div class="content">
  92. {{ item.content }}
  93. </div>
  94. </div>
  95. {% endfor %}
  96. </div>
  97. {% else %}
  98. {% for item in child.collection %}
  99. <h4>{{ item.title }}</h4>
  100. {{ item.content }}
  101. <div class="images">
  102. {% for images in item.media.images %}
  103. {{ images.html }}
  104. {% endfor %}
  105. </div>
  106. {% endfor %}
  107. {% endif %}
  108. </section>
  109. {% endfor %}
  110. </section>
  111. {% endfor %}
  112. {% endblock %}