modular-event.html.twig 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. {#
  11. {% block bottom %}
  12. {{ parent() }}
  13. {% if show_onpage_menu %}
  14. <script>
  15. // singlePageNav initialization & configuration
  16. $('#navbar').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() %}
  29. {% set current_module = (module.active or module.activeChild) ? 'active' : '' %}
  30. <li class="{{ current_module }}"><a href="#{{ _self.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 content %}
  46. {{ page.content|raw }}
  47. {% for module in page.collection() %}
  48. <div id="{{ _self.pageLinkName(module.menu) }}"></div>
  49. {{ module.content|raw }}
  50. {% endfor %}
  51. {% endblock %}