templates/includes/header-nav.html.twig line 1
{% set header = content.headerType %}
<header class="header header--{{ header }}" x-data="header">
<div class="header__container">
<a href="{{ sulu_content_root_path() }}" class="header__logo">
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 298 62">
<path d="M198.1 40.178L177.27 0h-14.969v61.223h13.668V21.045l20.83 40.178h14.97V0H198.1v40.178zm96.811-24.92c-2.066-4.608-5.245-8.303-9.556-11.085C281.034 1.39 275.68 0 269.283 0h-23.354v61.223l48.137-13.793c.269-.499.517-.998.755-1.518 2.116-4.64 3.169-9.737 3.169-15.311.01-5.617-1.023-10.724-3.079-15.343zM282.623 39.53c-1.142 2.75-2.851 4.97-5.125 6.658-2.275 1.677-5.047 2.516-8.295 2.516h-9.595V12.52h9.595c3.258 0 6.02.838 8.295 2.527 2.274 1.677 3.983 3.896 5.125 6.646 1.143 2.75 1.709 5.723 1.709 8.92 0 3.185-.566 6.158-1.709 8.918zM74.927 0H61.26l-8.056 61.223H90.95l1.629-12.519H68.5L74.927 0zm42.127 0L95.579 61.223h14.313l3.656-11.478h23.929l3.656 11.478h14.324L133.981 0h-16.927zm.269 37.916l8.195-25.737 8.195 25.737h-16.39zM44.71 2.654C41.58.881 37.558 0 32.62 0H8.056L0 61.223h13.668l2.762-20.875h12.208c4.34 0 8.215-.945 11.632-2.824 3.417-1.88 6.158-4.396 8.215-7.518 2.056-3.132 3.337-6.52 3.824-10.172.487-3.705.12-7.06-1.103-10.044-1.212-2.995-3.387-5.373-6.496-7.136zm-6.149 17.87c-.328 2.432-1.44 4.375-3.337 5.83-1.898 1.454-4.262 2.176-7.083 2.176H17.98l2.116-16h10.172c2.93 0 5.135.668 6.625 1.995 1.49 1.338 2.047 3.334 1.67 6z"
fill="currentColor"/>
</svg>
</a>
<div class="header__nav">
<div class="header__nav-center">
{# <!-- Fly-Out Navigation --> #}
{% set flyout = flyout() %}
{% set currentFlyout = (flyout is not empty and flyout[app.request.locale] is defined) ? flyout[app.request.locale] : [] %}
{% set flyoutPages = currentFlyout is not empty ? currentFlyout|keys : [] %}
<!-- {{ flyoutPages|join(' --- ') }} -->
{# <!-- Fallback --> #}
{% if flyout is empty %}
<nav class="header-nav">
{% for item in sulu_navigation_root_tree('main') %}
{% set itemUrl = sulu_content_path(item.url) %}
<a class="header-nav__link {{ app.request.uri starts with itemUrl ? 'active' : '' }}"
href="{{ sulu_content_path(item.url, item.webspaceKey) }}"
title="{{ item.title }}">{{ item.title }}</a>
{% endfor %}
</nav>
{% else %}
<nav class="flyout-nav" x-data="flyoutnav">
{% set mainNavigation = sulu_navigation_root_tree('main') %}
{% for item in mainNavigation %}
{% set itemUrl = sulu_content_path(item.url) %}
{% set activeNav = app.request.uri starts with itemUrl ? 'active' : '' %}
{# <!-- Flyout --> #}
{% if flyoutPages is not empty and item.url in flyoutPages %}
<div class="flyout-nav__item {{ activeNav }}" data-flyout title="{{ item.title }}">
{{ item.title }}
</div>
{% else %}
{# <!-- Without Flyout - Normal navigation --> #}
<a class="flyout-nav__item {{ activeNav }}"
href="{{ sulu_content_path(item.url, item.webspaceKey) }}" hreflang="{{ app.request.locale }}"
title="{{ item.title }}">{{ item.title }}
</a>
{% endif %}
{% endfor %}
{# <!-- Navigation contents --> #}
{% if currentFlyout is not empty %}
<div class="flyout-nav__flyout" x-ref="flyout">
<div class="flyout-nav__flyout-inner" x-ref="flyoutInner">
<div class="flyout-nav__background" x-ref="background">
<div class="flyout-nav__arrow" x-ref="arrow"></div>
</div>
{% for item in mainNavigation %}
{% if item.url in flyoutPages %}
{% set flyoutPage = currentFlyout[item.url] %}
{% if flyoutPage['layout'] == 'Layout 1' %}
{% include '/includes/navigation/layout1.html.twig' %}
{% elseif flyoutPage['layout'] == 'Layout 2' %}
{% include 'includes/navigation/layout2.html.twig' %}
{% else %}
{% include 'includes/navigation/layout3.html.twig' %}
{% endif %}
{% endif %}
{% endfor %}
</div>
</div>
{% endif %}
</nav>
{% endif %}
</div>
<div class="header__nav-right">
<div class="languageswitch" x-data="languageswitch">
<div class="languageswitch__button">
<span class="languageswitch__button-inner">
<span class="languageswitch__button-arrow">
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">
<path d="M7.5 14.5c1.657 0 3-3.134 3-7s-1.343-7-3-7-3 3.134-3 7 1.343 7 3 7ZM.5 7.5h14"
stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M7.5 14.5a7 7 0 1 0 0-14 7 7 0 0 0 0 14Z" stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round"/>
</svg>
</span>
{{ app.request.getLocale()|upper }}
</span>
<select class="languageswitch__select" x-ref="select">
{% for localization in localizations %}
<option value="{{ localization.url }}"
{% if localization.locale == app.request.getLocale() %} selected {% endif %}>
{{ localization.locale|upper }}
</option>
{% endfor %}
</select>
</div>
</div>
</div>
</div>
<div class="header__actions">
<div class="languageswitch" x-data="languageswitch">
<div class="languageswitch__button">
<span class="languageswitch__button-inner">
<span class="languageswitch__button-arrow">
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">
<path d="M7.5 14.5c1.657 0 3-3.134 3-7s-1.343-7-3-7-3 3.134-3 7 1.343 7 3 7ZM.5 7.5h14"
stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M7.5 14.5a7 7 0 1 0 0-14 7 7 0 0 0 0 14Z" stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round"/>
</svg>
</span>
{{ app.request.getLocale()|upper }}
</span>
<select class="languageswitch__select" x-ref="select">
{% for localization in localizations %}
<option value="{{ localization.url }}"
{% if localization.locale == app.request.getLocale() %} selected {% endif %}>
{{ localization.locale|upper }}
</option>
{% endfor %}
</select>
</div>
</div>
<a href="#" class="header__action" @click="showMobileNav = true">
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
<path d="M1.5 2.5h14" stroke="currentColor" stroke-miterlimit="10" stroke-linecap="round"
stroke-linejoin="round"/>
<path d="M1.5 8.5h14M1.5 14.5h14" stroke="currentColor" stroke-miterlimit="10"
stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</a>
</div>
</div>
<div class="header__mobile-nav">
{{ include('/includes/mobile-nav.html.twig') }}
</div>
</header>