custom/plugins/MoorlFoundation/src/Resources/views/storefront/element/cms-element-sidebar-filter.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/element/cms-element-sidebar-filter.html.twig' %}
  2. {% block element_sidebar_filter %}
  3.     {% set slot = null %}
  4.     {% if cmsPage is defined %}
  5.         {% set config = element.fieldConfig.elements %}
  6.         {% set slot = cmsPage.firstElementOfType('product-listing') %}
  7.         {% if not slot %}
  8.             {% for section in cmsPage.sections %}
  9.                 {% for blocks in section.blocks %}
  10.                     {% if blocks.slots %}
  11.                         {% for _slot in blocks.slots %}
  12.                             {% if _slot.fieldConfig.elements.listingSource.value == 'auto' %}
  13.                                 {% set slot = _slot %}
  14.                             {% endif %}
  15.                         {% endfor %}
  16.                     {% endif %}
  17.                 {% endfor %}
  18.             {% endfor %}
  19.         {% endif %}
  20.         {% if not slot %}
  21.             {% sw_include '@Storefront/storefront/utilities/alert.html.twig' with {
  22.                 type: 'warning',
  23.                 content: 'moorl-foundation.search.noListingSlotFound'|trans|sw_sanitize
  24.             } %}
  25.         {% endif %}
  26.         {% set listing = slot.data.listing %}
  27.         {% set sidebar = block.sectionPosition == 'sidebar' %}
  28.     {% endif %}
  29.     {% if listing.aggregations.elements|length > 0 %}
  30.         <div class="cms-element-sidebar-filter">
  31.             {{ block('element_product_listing_filter_button') }}
  32.             {{ block('element_sidebar_filter_panel') }}
  33.         </div>
  34.     {% endif %}
  35. {% endblock %}