templates/navigation/meta.html.twig line 1

Open in your IDE?
  1. {#
  2. project: Pimcore - Schutzverband Nuernberg Rostbratwuerste
  3. User: erikb
  4. Year: 2022
  5. #}
  6. {# get the document which should be used to start in navigation | default home #}
  7. {% set navStartNode = document.getProperty('navigation-root-meta') %}
  8. {% if not navStartNode is instanceof('\\Pimcore\\Model\\Document\\Folder') and not navStartNode is  instanceof('\\Pimcore\\Model\\Document\\Page')%}
  9.     {% set navStartNode = pimcore_document(1) %}
  10. {% endif %}
  11. {% set mainNavigation = custom_build_nav(document, navStartNode) %}
  12. {% set menuRenderer = pimcore_nav_renderer('menu') %}
  13. {% set content %}
  14.     {% for page in mainNavigation %}
  15.         {% if page.isVisible() and menuRenderer.accept(page) and not page.getCustomSetting('navigationItemVirtual')  %}
  16.             {% set activeClass = page.getActive(true) ? 'navigation__item--active' : '' %}
  17.             <li class="navigation__item {{ activeClass }}">
  18.                 <a href="{{ page.getHref() }}"
  19.                    class="navigation__link"
  20.                    target="{{ page.getTarget() }}"
  21.                    aria-label="{{ page.getLabel() }}" {% if page.getActive(false) %}aria-current="page"{% endif %}>
  22.                     {{ page.getLabel() }}
  23.                 </a>
  24.             </li>
  25.         {% endif %}
  26.     {% endfor %}
  27. {% endset %}
  28. <nav class="navigation navigation--{{ class|default('meta') }}" aria-label="{{ 'wcag.label.navigation-meta'|trans }}">
  29.     <ul class="navigation__container">
  30.         {{ content }}
  31.     </ul>
  32. </nav>