{#
project: Pimcore - Schutzverband Nuernberg Rostbratwuerste
User: erikb
Year: 2022
#}
{# get the document which should be used to start in navigation | default home #}
{% set navStartNode = document.getProperty('navigation-root-service') %}
{% if not navStartNode is instanceof('\\Pimcore\\Model\\Document\\Folder') and not navStartNode is instanceof('\\Pimcore\\Model\\Document\\Page')%}
{% set navStartNode = pimcore_document(1) %}
{% endif %}
{% set mainNavigation = custom_build_nav(document, navStartNode) %}
{% set menuRenderer = pimcore_nav_renderer('menu') %}
{% set content %}
{% for page in mainNavigation %}
{% if page.isVisible() and menuRenderer.accept(page) and not page.getCustomSetting('navigationItemVirtual') %}
{% set activeClass = page.getActive(true) ? 'navigation__item--active' : '' %}
<li class="navigation__item {{ activeClass }}">
<a href="{{ page.getHref() }}"
class="navigation__link"
target="{{ page.getTarget() }}"
aria-label="{{ page.getLabel() }}" {% if page.getActive(false) %}aria-current="page"{% endif %}>
{{ page.getLabel() }}
</a>
</li>
{% endif %}
{% endfor %}
{% endset %}
<nav class="navigation navigation--{{ class|default('service') }}" aria-label="{{ 'wcag.label.navigation-service'|trans }}">
<ul class="navigation__container">
{{ content }}
</ul>
</nav>