{% sw_extends '@Storefront/storefront/layout/navigation/navigation.html.twig' %}
{% block layout_main_navigation %}
<div class="main-navigation"
id="mainStickyNavigation"
data-flyout-menu="true">
{% block layout_main_navigation_navbar %}
{{ parent() }}
{% endblock %}
{% block layout_main_navigation_menu_flyout_wrapper %}
{{ parent() }}
{% endblock %}
</div>
{% endblock %}
{% block layout_main_navigation_menu %}
{{ parent() }}
{% endblock %}
{% block layout_main_navigation_menu_items %}
{% for treeItem in page.header.navigation.tree %}
{% set category = treeItem.category %}
{% set name = category.translated.name %}
{% set categorId = category.id %}
{% block layout_main_navigation_menu_item %}
{% if category.type == 'folder' %}
<div class="nav-link main-navigation-link"
{% if treeItem.children|length > 0 %}
data-flyout-menu-trigger="{{ categorId }}"
{% endif %}
title="{{ name }}">
<div class="main-navigation-link-text">
<span itemprop="name">{{ name }}</span>
</div>
</div>
{% else %}
<div class="nav-dropdown-link">
{% if category.translated.customFields.custom_category_field_only_logged %}
{% if context.customer %}
<a class="nav-link main-navigation-link{% if categorId is same as(page.header.navigation.active.id) or categorId is same as(page.header.navigation.active.parentId) %} active{% endif %}"
href="{% if category.externalLink %}{{ category.externalLink }}{% else %}{{ seoUrl('frontend.navigation.page', { navigationId: categorId }) }}{% endif %}"
itemprop="url"
{% if treeItem.children|length > 0 %}
data-flyout-menu-trigger="{{ categorId }}"
{% endif %}
title="{{ name }}">
<div class="main-navigation-link-text">
<span itemprop="name">{{ name }}</span>
</div>
</a>
{% else %}
<a class="nav-link main-navigation-link{% if categorId is same as(page.header.navigation.active.id) or categorId is same as(page.header.navigation.active.parentId) %} active{% endif %}"
href="{{ path('frontend.account.login.page', {redirectTo: 'frontend.navigation.page', redirectParameters:'{"navigationId":"'~categorId~'"}'}) }}"
itemprop="url"
{% if treeItem.children|length > 0 %}
data-flyout-menu-trigger="{{ categorId }}"
{% endif %}
title="{{ name }}">
<div class="main-navigation-link-text">
<span itemprop="name">{{ name }}</span>
</div>
</a>
{% endif %}
{% else %}
<a class="nav-link main-navigation-link{% if categorId is same as(page.header.navigation.active.id) or categorId is same as(page.header.navigation.active.parentId) %} active{% endif %}"
href="{% if category.externalLink %}{{ category.externalLink }}{% else %}{{ seoUrl('frontend.navigation.page', { navigationId: categorId }) }}{% endif %}"
itemprop="url"
{% if treeItem.children|length > 0 %}
data-flyout-menu-trigger="{{ categorId }}"
{% endif %}
title="{{ name }}">
<div class="main-navigation-link-text">
<span itemprop="name">{{ name }}</span>
</div>
</a>
{% endif %}
{% sw_include '@Storefront/storefront/layout/navigation/navigation-dropdown.html.twig' with {
childrenTree: treeItem.children
} %}
</div>
{% endif %}
{% endblock %}
{% endfor %}
{% endblock %}
{% block layout_main_navigation_menu_flyout_container %}
{% endblock %}