{% sw_extends '@Storefront/storefront/layout/navigation/flyout.html.twig' %}
{% block layout_navigation_flyout %}
{% set navTreeChildrens= navigationTree.children %}
{% set name = category.translated.name %}
{% block layout_navigation_flyout_bar %}
{% endblock %}
{% block layout_navigation_flyout_content %}
<div class="row navigation-flyout-content flex-nowrap">
{% block layout_navigation_flyout_categories %}
<div class="navigation-categories-list {% if category.media %}{% else %}{% endif %} p-0">
<div class="navigation-flyout-categories">
{% block layout_navigation_flyout_categories_recoursion %}
<span class="navigation-flyout-categories-headline">{{ 'header.categoriesHeadline'|trans|sw_sanitize }}</span>
{% for treeItem in navTreeChildrens %}
{% set isOpen = loop.index0 is same as(0) %}
{% 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"
data-flyout-category-trigger="{{ category.id }}"
title="{{ name }}">
<div class="main-navigation-link-text">
<span itemprop="name">{{ name }}</span>
</div>
</div>
{% else %}
<a class="nav-link main-navigation-link {% if isOpen %} is-open{% endif %}"
href="{{ category_url(category) }}"
itemprop="url"
data-flyout-category-trigger="{{ category.id }}"
{% if category_linknewtab(category) %}target="_blank"{% endif %}
title="{{ name }}">
<div class="main-navigation-link-text">
<span itemprop="name">{{ name }}</span>
</div>
</a>
{% endif %}
{% endblock %}
{% endfor %}
{% endblock %}
</div>
</div>
{% endblock %}
{% set seprateCategory = '' %}
{% set middleColumnCategory = 'Leitsysteme' %}
{% for item in mainNavigation %}
{% if middleColumnCategory in item.category.name %}
{% set seprateCategory = item %}
{% endif %}
{% endfor %}
{% for treeItem in navTreeChildrens %}
{% set isOpen = loop.index0 is same as(0) %}
{% set customFields = treeItem.category.customFields %}
{% set banner = customFields.custom_category_menu_banner_img %}
{% if banner %}
{% set iconMediaId = customFields.custom_category_menu_banner_img %}
{% set media = searchMedia([iconMediaId], context.context) %}
{% set icon = media.get(iconMediaId) %}
{% endif %}
<div class="navigation-flyout-category-wrapper row flex-nowrap m-0 p-0 {% if isOpen %}is-open{% endif %}"
data-flyout-category-id="{{ treeItem.category.id }}"
>
<div class="row flex-nowrap m-0">
<div class="category-card-section {% if isFirstCategory %} {% else %} d-none {% endif %}">
<a class="main-category-name " href="{{ category_url(seprateCategory.category) }}">
{% if seprateCategory.category.customFields.custom_category_info_custom_name %}
{{ seprateCategory.category.customFields.custom_category_info_custom_name }}
{% else %}
{{ seprateCategory.category.translated.name }}
{% endif %}
<span class="arrow-right-rotate">
{% sw_icon 'arrow_left' style {
'namespace': 'Tuerschild_2',
} %} </span> </a>
<div class=" m-0 categories-list">
{% for subcategory in seprateCategory.children %}
{% set categoryColor = subcategory.category.customFields.custom_category_info_color %}
{% if subcategory.category.mediaId %}
{% set imgMediaId = subcategory.category.mediaId %}
{% set media = searchMedia([imgMediaId], context.context) %}
{% set img = media.get(imgMediaId) %}
{% endif %}
<div class="category-card">
<a href="{{ category_url(subcategory.category) }}"
alt="{{ subcategory.category.translated.name }}" class="category-card-wrapper">
{% sw_thumbnails 'product-image-thumbnails' with {
media: img,
sizes: {
'xs': '218px',
'sm': '218px',
'md': '218px',
'lg': '218px',
'xl': '218px',
},
attributes: {
'class': 'category-card-image',
'alt': ( subcategory.category.translated.name ?: ''),
}
} %}
<span class="category-card-name">{{ subcategory.category.translated.name }}</span>
<div class="background-container"
style="background-color:{{ categoryColor }}"></div>
</a>
</div>
{% endfor %}
</div>
</div>
{% block layout_navigation_flyout_teaser %}
<div class="category-banner {% if not isFirstCategory %}full-width{% endif %}">
<div class="navigation-flyout-teaser">
<span class="category-banner-headline">{{ customFields.custom_category_menu_banner_headline }}</span>
{% block layout_navigation_flyout_teaser_image %}
{% if banner %}
{# <a class="navigation-flyout-teaser-image-container {% if treeItem.children == false %}mw-100 bigger{% endif %}" #}
<a class="navigation-flyout-teaser-image-container"
href="{{ customFields.custom_category_menu_banner_url }}">
<img src="{{ icon.url }}" class="navigation-flyout-teaser-image"
data-object-fit="cover">
</a>
{% endif %}
{% endblock %}
</div>
{% block layout_navigation_top_products %}
{% set topProducts = false %}
{% set categoryTopProducts = false %}
{% for item in mainNavigation %}
{% if item.category.name is same as('TOP Produktreihen') %}
{% set topProducts = item.children %}
{% set categoryTopProducts = item.category %}
{% endif %}
{% endfor %}
{% if isFirstCategory and topProducts %}
<span class="navigation-flyout-categories-headline top-products">{{ categoryTopProducts.translated.name }}</span>
<ul class="top-product-list">
{% for product in topProducts %}
<li class="product-item">
<a href="{{ category_url(product.category) }}"
class="nav-link">{{ product.category.name }}</a>
</li>
{% endfor %}
</ul>
{% endif %}
{% endblock %}
</div>
{% endblock %}
</div>
</div>
{% endfor %}
{% endblock %}
</div>
{% endblock %}