custom/plugins/SchilderSysteme/src/Resources/views/storefront/layout/navigation/flyout.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/layout/navigation/flyout.html.twig' %}
  2. {% block layout_navigation_flyout %}
  3.     {% set navTreeChildrens= navigationTree.children %}
  4.     {% set name = category.translated.name %}
  5.     {% block layout_navigation_flyout_bar %}
  6.     {% endblock %}
  7.     {% block layout_navigation_flyout_content %}
  8.         <div class="row navigation-flyout-content flex-nowrap">
  9.         {% block layout_navigation_flyout_categories %}
  10.             <div class="navigation-categories-list {% if category.media %}{% else %}{% endif %} p-0">
  11.                 <div class="navigation-flyout-categories">
  12.                     {% block layout_navigation_flyout_categories_recoursion %}
  13.                         <span class="navigation-flyout-categories-headline">{{ 'header.categoriesHeadline'|trans|sw_sanitize }}</span>
  14.                         {% for treeItem in navTreeChildrens %}
  15.                             {% set isOpen = loop.index0 is same as(0) %}
  16.                             {% set category = treeItem.category %}
  17.                             {% set name = category.translated.name %}
  18.                             {# @deprecated tag:v6.5.0 - Use "category.id" directly instead. #}
  19.                             {% set categorId = category.id %}
  20.                             {% block layout_main_navigation_menu_item %}
  21.                                 {% if category.type == 'folder' %}
  22.                                     <div class="nav-link main-navigation-link"
  23.                                          data-flyout-category-trigger="{{ category.id }}"
  24.                                          title="{{ name }}">
  25.                                         <div class="main-navigation-link-text">
  26.                                             <span itemprop="name">{{ name }}</span>
  27.                                         </div>
  28.                                     </div>
  29.                                 {% else %}
  30.                                     <a class="nav-link main-navigation-link {% if isOpen %} is-open{% endif %}"
  31.                                        href="{{ category_url(category) }}"
  32.                                        itemprop="url"
  33.                                        data-flyout-category-trigger="{{ category.id }}"
  34.                                        {% if category_linknewtab(category) %}target="_blank"{% endif %}
  35.                                        title="{{ name }}">
  36.                                         <div class="main-navigation-link-text">
  37.                                             <span itemprop="name">{{ name }}</span>
  38.                                         </div>
  39.                                     </a>
  40.                                 {% endif %}
  41.                             {% endblock %}
  42.                         {% endfor %}
  43.                     {% endblock %}
  44.                 </div>
  45.             </div>
  46.         {% endblock %}
  47.         {% set seprateCategory = '' %}
  48.         {% set middleColumnCategory = 'Leitsysteme' %}
  49.         {% for item in mainNavigation %}
  50.             {% if middleColumnCategory  in item.category.name %}
  51.                 {% set seprateCategory = item %}
  52.             {% endif %}
  53.         {% endfor %}
  54.         {% for treeItem in navTreeChildrens %}
  55.             {% set isOpen = loop.index0 is same as(0) %}
  56.             {% set customFields =  treeItem.category.customFields %}
  57.             {% set banner = customFields.custom_category_menu_banner_img %}
  58.             {% if banner %}
  59.                 {% set iconMediaId = customFields.custom_category_menu_banner_img %}
  60.                 {% set media = searchMedia([iconMediaId], context.context) %}
  61.                 {% set icon = media.get(iconMediaId) %}
  62.             {% endif %}
  63.             <div class="navigation-flyout-category-wrapper row flex-nowrap m-0 p-0 {% if isOpen %}is-open{% endif %}"
  64.                  data-flyout-category-id="{{ treeItem.category.id }}"
  65.             >
  66.                 <div class="row flex-nowrap m-0">
  67.                     <div class="category-card-section  {% if isFirstCategory %}  {% else %} d-none {% endif %}">
  68.                         <a class="main-category-name " href="{{ category_url(seprateCategory.category) }}">
  69.                             {% if seprateCategory.category.customFields.custom_category_info_custom_name %}
  70.                                 {{ seprateCategory.category.customFields.custom_category_info_custom_name }}
  71.                             {% else %}
  72.                                 {{ seprateCategory.category.translated.name }}
  73.                             {% endif %}
  74.                             <span class="arrow-right-rotate">
  75.                             {% sw_icon 'arrow_left'  style {
  76.                                 'namespace': 'Tuerschild_2',
  77.                             } %} </span> </a>
  78.                         <div class=" m-0 categories-list">
  79.                             {% for subcategory in seprateCategory.children %}
  80.                                 {% set categoryColor = subcategory.category.customFields.custom_category_info_color %}
  81.                                 {% if subcategory.category.mediaId %}
  82.                                     {% set imgMediaId  = subcategory.category.mediaId %}
  83.                                     {% set media = searchMedia([imgMediaId], context.context) %}
  84.                                     {% set img = media.get(imgMediaId) %}
  85.                                 {% endif %}
  86.                                 <div class="category-card">
  87.                                     <a href="{{ category_url(subcategory.category) }}"
  88.                                        alt="{{ subcategory.category.translated.name }}" class="category-card-wrapper">
  89.                                         {% sw_thumbnails 'product-image-thumbnails' with {
  90.                                             media: img,
  91.                                             sizes: {
  92.                                                 'xs': '218px',
  93.                                                 'sm': '218px',
  94.                                                 'md': '218px',
  95.                                                 'lg': '218px',
  96.                                                 'xl': '218px',
  97.                                             },
  98.                                             attributes: {
  99.                                                 'class': 'category-card-image',
  100.                                                 'alt': ( subcategory.category.translated.name  ?: ''),
  101.                                             }
  102.                                         } %}
  103.                                         <span class="category-card-name">{{ subcategory.category.translated.name }}</span>
  104.                                         <div class="background-container"
  105.                                              style="background-color:{{ categoryColor }}"></div>
  106.                                     </a>
  107.                                 </div>
  108.                             {% endfor %}
  109.                         </div>
  110.                     </div>
  111.                     {% block layout_navigation_flyout_teaser %}
  112.                         <div class="category-banner {% if not isFirstCategory %}full-width{% endif %}">
  113.                             <div class="navigation-flyout-teaser">
  114.                                 <span class="category-banner-headline">{{ customFields.custom_category_menu_banner_headline }}</span>
  115.                                 {% block layout_navigation_flyout_teaser_image %}
  116.                                     {% if banner %}
  117.                                         {# <a class="navigation-flyout-teaser-image-container  {% if treeItem.children == false %}mw-100 bigger{% endif %}" #}
  118.                                         <a class="navigation-flyout-teaser-image-container"
  119.                                            href="{{ customFields.custom_category_menu_banner_url }}">
  120.                                             <img src="{{ icon.url }}" class="navigation-flyout-teaser-image"
  121.                                                  data-object-fit="cover">
  122.                                         </a>
  123.                                     {% endif %}
  124.                                 {% endblock %}
  125.                             </div>
  126.                             {% block layout_navigation_top_products %}
  127.                                 {% set topProducts = false %}
  128.                                 {% set categoryTopProducts = false %}
  129.                                 {% for item in mainNavigation %}
  130.                                     {% if item.category.name is same as('TOP Produktreihen') %}
  131.                                         {% set topProducts = item.children %}
  132.                                         {% set categoryTopProducts = item.category %}
  133.                                     {% endif %}
  134.                                 {% endfor %}
  135.                                 {% if isFirstCategory and topProducts %}
  136.                                     <span class="navigation-flyout-categories-headline top-products">{{ categoryTopProducts.translated.name }}</span>
  137.                                     <ul class="top-product-list">
  138.                                         {% for product in topProducts %}
  139.                                             <li class="product-item">
  140.                                                 <a href="{{ category_url(product.category) }}"
  141.                                                    class="nav-link">{{ product.category.name }}</a>
  142.                                             </li>
  143.                                         {% endfor %}
  144.                                     </ul>
  145.                                 {% endif %}
  146.                             {% endblock %}
  147.                         </div>
  148.                     {% endblock %}
  149.                 </div>
  150.             </div>
  151.         {% endfor %}
  152.     {% endblock %}
  153.     </div>
  154. {% endblock %}