{% block layout_navigation_categories %}
{% if not level %}
{% set level = 0 %}
{% endif %}
{% if not requestlevel %}
{% set requestlevel = 0 %}
{% endif %}
{% set activeId = page.header.navigation.active.id %}
{% set activePath = page.header.navigation.active.path %}
{% if level == requestlevel %}
<div class="megamenu-categories" data-category-id="{{navigationTree.category.id}}">
{% for treeItem in navigationTree.children %}
{% if context.salesChannel.id =='3213ffda35704f1a84f5e7376117a2a2' and treeItem.category.customFields.custom_category_usa_disable %}
{% else %}
{% set id = treeItem.category.id %}
{% set name = treeItem.category.translated.name %}
{% set link = category_url(treeItem.category) %}
{% block layout_navigation_categories_item %}
<div class="megamenu-item {% if treeItem.children|length > 0 %}has-child{% endif %}" main-category-id="{{id}}">
{% block layout_navigation_categories_item_link %}
{% if treeItem.category.type == 'folder' %}
<div class="nav-item nav-link navigation-flyout-link"
title="{{ name }}">
{% if treeItem.category.media %}
{% sw_thumbnails 'navigation-flyout-teaser-image-thumbnails' with {
media: treeItem.category.media,
sizes: {
'default': '60px'
},
attributes: {
'class': 'navigation-flyout-teaser-image',
'alt': (treeItem.category.media.translated.alt ?: ''),
'title': (treeItem.category.media.translated.title ?: ''),
'data-object-fit': 'cover'
}
} %}
{% endif %}
<span itemprop="name">{{ name }}</span>
</div>
{% else %}
<a class="nav-item nav-link navigation-flyout-link {% if id == activeId or id in activePath %} active{% endif %}"
href="{{ link }}"
itemprop="url"
{% if category_linknewtab(treeItem.category) %}target="_blank"
{% if treeItem.category.linkType == "external" %}rel="noopener noreferrer"{% endif %}
{% endif %}
title="{{ name }}">
{% if treeItem.category.media %}
{% sw_thumbnails 'navigation-flyout-teaser-image-thumbnails' with {
media: treeItem.category.media,
sizes: {
'default': '60px'
},
attributes: {
'class': 'navigation-flyout-teaser-image',
'alt': (treeItem.category.media.translated.alt ?: ''),
'title': (treeItem.category.media.translated.title ?: ''),
'data-object-fit': 'cover'
}
} %}
{% endif %}
<span itemprop="name">{{ name }}</span>
</a>
{% endif %}
{% endblock %}
</div>
{% endblock %}
{% endif %}
{% endfor %}
</div>
{% else %}
{% for treeItem in navigationTree.children %}
{% sw_include '@Storefront/storefront/layout/navigation/megamenu_level.html.twig' with {
navigationTree: treeItem,
level: level,
requestlevel : requestlevel+1,
page: page
} only %}
{% endfor %}
{% endif %}
{% endblock %}