custom/plugins/SchrammTheme/src/Resources/views/storefront/component/product/listing.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/component/product/listing.html.twig' %}
  2. {% block element_product_listing_pagination_nav_top %}
  3.     {% set config = element.fieldConfig.elements %}
  4.     {% set slot = cmsPage.firstElementOfType('product-listing') %}
  5.         <div class="cms-element-sidebar-filter">
  6.             {% block element_product_listing_filter_button %}
  7.                 <button class="btn header-actions-btn filter-panel-wrapper-toggle"
  8.                         type="button"
  9.                         data-offcanvas-filter="true"
  10.                         aria-haspopup="true"
  11.                         aria-expanded="false"
  12.                         aria-label="{{ "general.menuLink"|trans }}">
  13.                     {{ "listing.filterTitleText"|trans }}
  14.                 </button>
  15.             {% endblock %}
  16.             {% block element_sidebar_filter_panel %}
  17.                 <div id="filter-panel-wrapper"
  18.                      class="filter-panel-wrapper"
  19.                      data-offcanvas-filter-content="true">
  20.                     {% sw_include '@Storefront/storefront/component/listing/filter-panel.html.twig' with {
  21.                         listing: slot.data.listing,
  22.                         sidebar: block.sectionPosition == 'sidebar'
  23.                     } %}
  24.                 </div>
  25.             {% endblock %}
  26.         </div>
  27. {% endblock %}
  28.  {% block element_product_listing_col %}
  29.      {% for product in searchResult %}
  30.          <div class="cms-listing-col col-sm-4">
  31.              {% block element_product_listing_box %}
  32.                  {% sw_include '@Storefront/storefront/component/product/card/box.html.twig' with {
  33.                      'layout': boxLayout,
  34.                      'displayMode': displayMode
  35.                  } %}
  36.              {% endblock %}
  37.          </div>
  38.      {% endfor %}
  39.  {% endblock %}
  40. {% block element_product_listing_sorting %}
  41. <div style="display: flex">
  42. <span style="margin-right: 5px" class="sort-label">
  43.      {{"listing.sortBy"|trans|sw_sanitize}}
  44. </span>
  45. {% set current = searchResult.sorting %}
  46. {% set sortings = searchResult.availableSortings %}
  47. {% set config = { sorting: current } %}
  48. {% if sortings|length > 1 %}
  49.     <div class="sorting" data-listing-sorting="true" data-listing-sorting-options='{{ config|json_encode }}'>
  50.         <select class="sorting custom-select" aria-label="{{ 'general.sortingLabel'|trans|striptags }}">
  51.             {% for sorting in sortings %}
  52.                 {% set key = sorting.key %}
  53.                 <option value="{{ key }}" {% if key == current %} selected{% endif %}>
  54.                     {{ sorting.translated.label|sw_sanitize }}
  55.                 </option>
  56.             {% endfor %}
  57.         </select>
  58.     </div>
  59. {% endif %}
  60. </div>
  61. {% endblock %}