custom/static-plugins/LdsSubCategories/src/Resources/views/storefront/element/cms-element-subcategories.html.twig line 1

Open in your IDE?
  1. {% block element_subcategories %}
  2.     {%  set config = element.fieldConfig.elements %}
  3.     {% if element.data.elements|filter(v => v.type != 'folder')|length > 0  %}
  4.         <div class="cms-element-subcategories" style="height: 100%; width: 100%">
  5.             <ul class="row">
  6.                 {% for subcategory in element.data.elements|filter(v => v.type != 'folder') %}
  7.                     {% set link = category_url(subcategory) %}
  8.                     {% if not subcategory.translated.customFields.migration_kewsw5_category_hide_in_navigation and subcategory.active and subcategory.visible %}
  9.                         <li class="col-md-4 col-6">
  10.                             <a href="{{ link }}" {% if category_linknewtab(subcategory) %} target="_blank" {% if subcategory.linkType == "external" %} rel="noopener noreferrer" {% endif %} {% endif %}>
  11.                                 <div class="cat-img">
  12.                                     {% if subcategory.media %}
  13.                                         {% sw_thumbnails 'moorl-listing-item-image-thumbnails' with {
  14.                                             media: subcategory.media,
  15.                                             attributes: {
  16.                                                 'itemprop': 'image',
  17.                                                 'alt': title,
  18.                                                 'class': "is-#{config.displayMode.value}",
  19.                                                 'style': imageCss|join(';'),
  20.                                                 'title': ''
  21.                                             }
  22.                                         } %}
  23.                                     {% else %}
  24.                                         <div class="product-image-placeholder">
  25.                                             {% sw_icon 'placeholder' style {
  26.                                         'size': 'fluid'
  27.                                     } %}
  28.                                         </div>
  29.                                     {% endif %}
  30.                                 </div>
  31.                                 <div class="cat-title">
  32.                                     {{subcategory.name}}
  33.                                 </div>
  34.                             </a>
  35.                         </li>
  36.                     {% endif %}
  37.                 {% endfor %}
  38.             </ul>
  39.         </div>
  40.     {% endif %}
  41. {% endblock %}