custom/plugins/LdsMegaMenu/src/Resources/views/storefront/layout/navigation/megamenu_level.html.twig line 1

Open in your IDE?
  1. {% block layout_navigation_categories %}
  2.     {% if not level %}
  3.         {% set level = 0 %}
  4.     {% endif %}
  5.     {% if not requestlevel %}
  6.         {% set requestlevel = 0 %}
  7.     {% endif %}
  8.     {% set activeId = page.header.navigation.active.id %}
  9.     {% set activePath = page.header.navigation.active.path %}
  10.     {% if level == requestlevel %}
  11.         
  12.         <div class="megamenu-categories" data-category-id="{{navigationTree.category.id}}">
  13.             {% for treeItem in navigationTree.children %}
  14.                 {% if context.salesChannel.id =='3213ffda35704f1a84f5e7376117a2a2' and treeItem.category.customFields.custom_category_usa_disable %}
  15.                 {% else %}
  16.                     {% set id = treeItem.category.id %}
  17.                     {% set name = treeItem.category.translated.name %}
  18.                     {% set link = category_url(treeItem.category) %}
  19.                     {% block layout_navigation_categories_item %}
  20.                         <div class="megamenu-item {% if treeItem.children|length > 0 %}has-child{% endif %}" main-category-id="{{id}}">
  21.                             {% block layout_navigation_categories_item_link %}
  22.                                 {% if treeItem.category.type == 'folder' %}
  23.                                     <div class="nav-item nav-link navigation-flyout-link"
  24.                                         title="{{ name }}">
  25.                                         {% if treeItem.category.media %}
  26.                                             {% sw_thumbnails 'navigation-flyout-teaser-image-thumbnails' with {
  27.                                                 media: treeItem.category.media,
  28.                                                 sizes: {
  29.                                                     'default': '60px'
  30.                                                 },
  31.                                                 attributes: {
  32.                                                     'class': 'navigation-flyout-teaser-image',
  33.                                                     'alt': (treeItem.category.media.translated.alt ?: ''),
  34.                                                     'title': (treeItem.category.media.translated.title ?: ''),
  35.                                                     'data-object-fit': 'cover'
  36.                                                 }
  37.                                             } %}
  38.                                         {% endif %}
  39.                                         <span itemprop="name">{{ name }}</span>
  40.                                     </div>
  41.                                 {% else %}
  42.                                     <a class="nav-item nav-link navigation-flyout-link {% if id == activeId or id in activePath %} active{% endif %}"
  43.                                     href="{{ link }}"
  44.                                     itemprop="url"
  45.                                     {% if category_linknewtab(treeItem.category) %}target="_blank"
  46.                                         {% if treeItem.category.linkType == "external" %}rel="noopener noreferrer"{% endif %}
  47.                                     {% endif %}
  48.                                     title="{{ name }}">
  49.                                         {% if treeItem.category.media %}
  50.                                             {% sw_thumbnails 'navigation-flyout-teaser-image-thumbnails' with {
  51.                                                 media: treeItem.category.media,
  52.                                                 sizes: {
  53.                                                     'default': '60px'
  54.                                                 },
  55.                                                 attributes: {
  56.                                                     'class': 'navigation-flyout-teaser-image',
  57.                                                     'alt': (treeItem.category.media.translated.alt ?: ''),
  58.                                                     'title': (treeItem.category.media.translated.title ?: ''),
  59.                                                     'data-object-fit': 'cover'
  60.                                                 }
  61.                                             } %}
  62.                                         {% endif %}
  63.                                         <span itemprop="name">{{ name }}</span>
  64.                                     </a>
  65.                                 {% endif %}
  66.                             {% endblock %}
  67.                         </div>
  68.                     {% endblock %}
  69.                 {% endif %}
  70.             {% endfor %}
  71.         </div>
  72.     {% else %}
  73.         {% for treeItem in navigationTree.children %}
  74.             {% sw_include '@Storefront/storefront/layout/navigation/megamenu_level.html.twig' with {
  75.                 navigationTree: treeItem,
  76.                 level: level,
  77.                 requestlevel : requestlevel+1,
  78.                 page: page
  79.             } only %}
  80.         {% endfor %}
  81.     {% endif %}
  82. {% endblock %}