vendor/crehler/listing-banner/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_col %}
  3.     {% set productBanners = slot.data.listing.extensions.crehlerBanner ?? searchResult.extensions.crehlerBanner %}
  4.     {% for product in searchResult %}
  5.         {% if productBanners and productBanners is not empty %}
  6.             {% set desktopBanner = productBanners.desktopMedia|filter(media => media.position == loop.index-1) %}
  7.             {% set mobileBanner = productBanners.mobileMedia|filter(media => media.position == loop.index-1) %}
  8.             {% for banner in desktopBanner %}
  9.                 <div class="cms-listing-col {{ listingColumns }} d-none d-md-block">
  10.                     <div class="card product-box crehler-product-banner">
  11.                         <div class="card-body">
  12.                             <div class="product-image-wrapper">
  13.                                 {% if banner.link == null %}
  14.                                     {% sw_thumbnails 'product-banner-thumbnails' with {
  15.                                         media: banner.media,
  16.                                         sizes: sizes
  17.                                     } %}
  18.                                 {% else %}
  19.                                     <a href="{{ banner.link }}"
  20.                                        title="{{ banner.media.title }}"
  21.                                        class="">
  22.                                         {% sw_thumbnails 'product-banner-thumbnails' with {
  23.                                             media: banner.media,
  24.                                             sizes: sizes
  25.                                         } %}
  26.                                     </a>
  27.                                 {% endif %}
  28.                             </div>
  29.                         </div>
  30.                     </div>
  31.                 </div>
  32.             {% endfor %}
  33.             {% for banner in mobileBanner %}
  34.                 <div class="cms-listing-col {{ listingColumns }} d-md-none">
  35.                     <div class="card product-box crehler-product-banner">
  36.                         <div class="card-body">
  37.                             <div class="product-image-wrapper">
  38.                                 <a href="{{ banner.link }}"
  39.                                    title="{{ banner.media.title }}"
  40.                                    class="product-image-link">
  41.                                     {% sw_thumbnails 'product-banner-thumbnails' with {
  42.                                         media: banner.media,
  43.                                         sizes: sizes
  44.                                     } %}
  45.                                 </a>
  46.                             </div>
  47.                         </div>
  48.                     </div>
  49.                 </div>
  50.             {% endfor %}
  51.         {% endif %}
  52.         <div class="cms-listing-col {{ listingColumns }}">
  53.             {% block element_product_listing_box %}
  54.                 {{ parent() }}
  55.             {% endblock %}
  56.         </div>
  57.     {% endfor %}
  58. {% endblock %}