modular.html.twig 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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. {% endblock %}
  14. {% block header_navigation %}
  15. {% if show_onpage_menu %}
  16. <ul class="navigation">
  17. {% for module in page.collection() if module.template == 'blog' %}
  18. {% set current_module = (module.active or module.activeChild) ? 'active' : '' %}
  19. <li><a class="{{ current_module }}" href="#{{ macro.pageLinkName(module.menu)|hyphenize }}">{{ module.menu }}</a></li>
  20. {% endfor %}
  21. {% for mitem in site.menu %}
  22. <li>
  23. <a {% if mitem.class %}class="{{ mitem.class }}"{% endif %} href="{{ mitem.url }}">
  24. {% if mitem.icon %}<i class="fa fa-{{ mitem.icon }}"></i>{% endif %}
  25. {{ mitem.text }}
  26. </a>
  27. </li>
  28. {% endfor %}
  29. </ul>
  30. {% else %}
  31. {{ parent() }}
  32. {% endif %}
  33. {% endblock %}
  34. {% block hero %}
  35. {% for module in page.collection() if module.template == 'modular/hero' %}
  36. <div id="{{ macro.pageLinkName(module.menu) }}"></div>
  37. {{ module.content|raw }}
  38. {% endfor %}
  39. {% endblock %}
  40. {% block body %}
  41. <section id="{{ macro.pageLinkName(page.menu) }}">
  42. {{page.content}}
  43. </section>
  44. {% for module in page.collection() if module.template == 'blog' %}
  45. <section id="{{ macro.pageLinkName(module.menu)|hyphenize }}">
  46. <h2>{{ module.title }}</h2>
  47. <div class="arrow"></div>
  48. <div>
  49. {{ module.content|raw }}
  50. {% for child in module.collection %}
  51. {% set gal = child.header.blog.config %}
  52. <section id="{{ macro.pageLinkName(child.menu)|hyphenize }}">
  53. {% if child.title %}
  54. <div class="title">
  55. <h3>{{ child.title }}</h3>
  56. </div>
  57. {% endif %}
  58. {% if child.content %}
  59. <div class="content">
  60. {{ child.content }}
  61. </div>
  62. {% endif %}
  63. <div class="images">
  64. {% for images in child.media.images %}
  65. {{ images.html }}
  66. <div class="content">
  67. {{ child.content }}
  68. </div>
  69. {% endfor %}
  70. </div>
  71. {% if gal %}
  72. <div class="owl-carousel">
  73. {% for item in child.collection %}
  74. <div class="galerie">
  75. {% for images in item.media.images %}
  76. <div class="images">
  77. {{ images.html }}
  78. </div>
  79. {% endfor %}
  80. <div class="content">
  81. {{ item.content }}
  82. </div>
  83. </div>
  84. {% endfor %}
  85. </div>
  86. {% else %}
  87. {% for item in child.collection %}
  88. <h4>{{ item.title }}</h4>
  89. {{ item.content }}
  90. <div class="images">
  91. {% for images in item.media.images %}
  92. {{ images.html }}
  93. {% endfor %}
  94. </div>
  95. {% endfor %}
  96. {% endif %}
  97. </section>
  98. {% endfor %}
  99. </div>
  100. </section>
  101. {% endfor %}
  102. {% endblock %}