{% sw_extends '@Storefront/storefront/layout/navigation/navigation.html.twig' %}
{% block layout_main_navigation %}
{% set flyout_categories_trigger = "main-navigation-flyout" %}
{% set flyout_themen_trigger = "main-themen-flyout" %}
<div class="main-navigation"
id="mainNavigation"
data-flyout-menu="true">
{% block layout_main_navigation_navbar %}
<div class="container">
{% block layout_main_navigation_menu %}
<nav class="nav main-navigation-menu"
itemscope="itemscope"
itemtype="http://schema.org/SiteNavigationElement">
{% set homeLabel = context.salesChannel.translated.homeName|default("general.homeLink"|trans) %}
{% block layout_main_navigation_menu_home %}
{% endblock %}
{% block layout_main_navigation_menu_items %}
{% if page.product is defined %}
{% set activePath = page.product.categoryTree %}
{% else %}
{% set activePath = page.header.navigation.active.path %}
{% endif %}
{% for treeItem in page.header.navigation.tree %}
{% set category = treeItem.category %}
{% set name = category.translated.name %}
{# @deprecated tag:v6.5.0 - Use "category.id" directly instead. #}
{% 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="{{ category.id }}"
{% endif %}
title="{{ name }}">
<div class="main-navigation-link-text">
<span itemprop="name">{{ name }}</span>
</div>
</div>
{% else %}
<a class="nav-link main-navigation-link nav-link-{{ loop.index }}"
href="{{ category_url(category) }}"
itemprop="url"
{% if treeItem.children|length > 0 %} data-flyout-menu-trigger="{{ category.id }}"{% endif %}
{% if category_linknewtab(category) %}target="_blank"{% endif %}
title="{{ name }}">
<div class="main-navigation-link-text menu-link">
{% if name is same as("Produkte") %}
<span class="hamburger-menu"></span>
{% else %}
{% sw_icon 'arrow_down' style {
'namespace': 'Tuerschild_2',
} %}
{% endif %}
<span itemprop="name" class="hamburger-menu-text">{{ name }}</span>
</div>
</a>
{% endif %}
{% endblock %}
{% endfor %}
{% endblock %}
</nav>
{% endblock %}
</div>
{% endblock %}
{% block layout_main_navigation_menu_flyout_wrapper %}
{% set navigationChildrenCount = 0 %}
{% for treeItem in page.header.navigation.tree %}
{% if treeItem.category.childCount > 0 %}
{% set navigationChildrenCount = navigationChildrenCount + 1 %}
{% endif %}
{% endfor %}
{% if navigationChildrenCount > 0 %}
{% block layout_main_navigation_menu_flyout_container %}
<div class="navigation-flyouts" data-menu-categories-switcher="true">
{% block layout_main_navigation_menu_flyouts %}
{% for treeItem in page.header.navigation.tree %}
{% if treeItem.children|length > 0 %}
{% block layout_main_navigation_menu_flyout %}
<div class="navigation-flyout"
data-flyout-menu-id="{{ treeItem.category.id }}"
>
<div class="container">
{% block layout_main_navigation_menu_flyout_include %}
{% sw_include '@Storefront/storefront/layout/navigation/flyout.html.twig' with {navigationTree: treeItem, level: level+1, page: page} only %}
{% endblock %}
</div>
</div>
{% endblock %}
{% endif %}
{% endfor %}
{% endblock %}
</div>
{% endblock %}
{% endif %}
{% endblock %}
</div>
{% endblock %}