custom/plugins/S360MegaMenu/src/Resources/views/storefront/s360/megamenu/utilities/category-submenu.html.twig line 1

Open in your IDE?
  1. {% block s360_megamenu_category_submenu %}
  2.     <div class="s360-megamenu__columns__rows s360-megamenu-sub-categories">
  3.         {% set loopIndex = 1 %}
  4.         {% set break = false %}
  5.         {% for cat in categories %}
  6.             {% if not break %}
  7.                 {% if limit and limit > 0 and loopIndex > limit %}
  8.                     {% set break = true %}
  9.                 {% endif %}
  10.                 {% if cat.active and cat.visible and break == false %}
  11.                     {% set loopIndex = loopIndex + 1 %}
  12.                     {% block s360_megamenu_category_submenu_item %}
  13.                         <div class="s360-megamenu__item s360-megamenu-sub-category">
  14.                             {% set linkTarget = category_url(cat) %}
  15.                             <{% if cat.type == 'folder' %}span{% else %}a{% endif %}
  16.                                 class="s360-megamenu__link s360-megamenu__link--{{ cat.id }} s360-megamenu__link--level{{ cat.level }} {% if cat.id is same as(page.header.navigation.active.id) %} active{% endif %}"
  17.                                 {% if category.type != 'folder' %}
  18.                                     href="{{ linkTarget }}"
  19.                                     itemprop="url"
  20.                                     title="{{ cat.translated.name }}"
  21.                                 {% endif %}
  22.                             >
  23.                                 {% block s360_megamenu_category_content_detail %}
  24.                                     <div class="s360-megamenu-sub-category__detail {{ settings.categoryImageLeft ? 's360-megamenu-sub-category__detail__image--left' : 's360-megamenu-sub-category__detail__image--right' }}">
  25.                                         {# Category Header #}
  26.                                         {% block s360_megamenu_category_submenu_title %}
  27.                                             <div class="s360-megamenu-sub-category__title">{{ cat.translated.name }}</div>
  28.                                         {% endblock %}
  29.                                         {# Category Image #}
  30.                                         {% if settings.showSubCategoryImage and cat.media %}
  31.                                             {% block s360_megamenu_category_content_detail_image %}
  32.                                                 <img src="{{ cat.media.url }}" class="s360-megamenu-sub-category__detail__image img-fluid" alt="{{ cat.translated.name }}"/>
  33.                                             {% endblock %}
  34.                                         {% endif %}
  35.                                         {# Category Description #}
  36.                                         {% if settings.showSubCategoryDescription and cat.translated.description %}
  37.                                             {% block s360_megamenu_category_content_detail_description %}
  38.                                                 <div class="s360-megamenu-sub-category__detail__description">
  39.                                                     {{ cat.translated.description }}
  40.                                                 </div>
  41.                                             {% endblock %}
  42.                                         {% endif %}
  43.                                     </div>
  44.                                 {% endblock %}
  45.                             </{% if category.type == 'folder' %}span{% else %}a{% endif %}>
  46.                             {% if cat.children|length > 0 and (settings.maxSubSubcategories is not defined or settings.maxSubSubcategories != 0) %}
  47.                                 {% sw_include '@Storefront/storefront/s360/megamenu/utilities/category-submenu.html.twig' with { 'limit': settings.maxSubSubcategories, settings: settings, 'categories': cat.children } only %}
  48.                             {% endif %}
  49.                         </div>
  50.                     {% endblock %}
  51.                 {% endif %}
  52.             {% endif %}
  53.         {% endfor %}
  54.     </div>
  55. {% endblock %}