custom/plugins/NrbnLvgTheme/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. {% endblock %}
  4. {% block element_product_listing_row %}
  5.     {% if boxLayout == 'nr-slider' %}
  6.         {% set manufacturers = [] %}
  7.         {% for product in searchResult %}
  8.             {% if { name: product.manufacturer.name, lastName: product.manufacturer.customFields.nrbn_lvg_artist_lastname, media: product.manufacturer.media } not in manufacturers %}
  9.                 {% set manufacturers = manufacturers|merge([{ name: product.manufacturer.name, lastName: product.manufacturer.customFields.nrbn_lvg_artist_lastname, media: product.manufacturer.media }]) %}
  10.             {% endif %}
  11.         {% endfor %}
  12.         {% for manufacturer in manufacturers %}
  13.             <div class="nr-listing-section">
  14.                 <div class="nr-listing-header">
  15.                     <div class="row align-items-center">
  16.                         <div class="col">
  17.                             <div class="nr-listing-manufacturer">
  18.                                 {% if manufacturer.media %}
  19.                                     {% sw_thumbnails 'manufacturer-image-thumbnails' with {
  20.                                         media: manufacturer.media,
  21.                                         attributes: {
  22.                                             'class': 'nr-manufacturer-image',
  23.                                             'alt': manufacturer.name,
  24.                                         },
  25.                                         sizes: {
  26.                                             'default': '80px'
  27.                                         }
  28.                                     } %}
  29.                                 {% endif %}
  30.                                 <h2 class="nr-manufacturer-title">{{ manufacturer.name }}</h2>
  31.                             </div>
  32.                         </div>
  33.                         <div class="col-auto">
  34.                             <button class="nr-listing-subscribe" type="button">
  35.                                 <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" width="24" height="24">
  36.                                     <path stroke-linecap="round" stroke-linejoin="round" d="M19 7.5v3m0 0v3m0-3h3m-3 0h-3m-2.25-4.125a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zM4 19.235v-.11a6.375 6.375 0 0112.75 0v.109A12.318 12.318 0 0110.374 21c-2.331 0-4.512-.645-6.374-1.766z" />
  37.                                 </svg>
  38.                                 <span>Folgen</span>
  39.                             </button>
  40.                         </div>
  41.                     </div>
  42.                 </div>
  43.                 <div class="nr-listing-slider">
  44.                     {% set nrbnProductSliderOptions = {
  45.                         slider: {
  46.                             items: 1,
  47.                             autoWidth: true,
  48.                             gutter: 24,
  49.                             mouseDrag: true,
  50.                             swipeAngle: false,
  51.                             nav: false,
  52.                             loop: false,
  53.                             preventScrollOnTouch: 'auto',
  54.                         }
  55.                     } %}
  56.                     <div
  57.                         class="nrbn-slider"
  58.                         data-nrbn-slider="true"
  59.                         data-nrbn-slider-options="{{ nrbnProductSliderOptions|json_encode }}">
  60.                         <div class="nrbn-slider-container">
  61.                             {% for product in searchResult %}
  62.                                 {% if product.manufacturer.name == manufacturer.name %}
  63.                                     <div class="nrbn-slider-item">
  64.                                         {% sw_include '@Storefront/storefront/component/product/card/box.html.twig' with {
  65.                                             'layout': boxLayout,
  66.                                             'displayMode': displayMode
  67.                                         } %}
  68.                                     </div>
  69.                                 {% endif %}
  70.                             {% endfor %}
  71.                         </div>
  72.                         <div class="nrbn-slider-controls">
  73.                             <button class="nrbn-slider-controls-prev">
  74.                                 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"></polyline></svg>
  75.                             </button>
  76.                             <button class="nrbn-slider-controls-next">
  77.                                 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg>
  78.                             </button>
  79.                         </div>
  80.                     </div>
  81.                 </div>
  82.             </div>
  83.         {% endfor %}
  84.     {% elseif boxLayout == 'nr-manufacturer' %}
  85.         {% set manufacturers = [] %}
  86.         {% for product in searchResult %}
  87.             {% if { name: product.manufacturer.name, lastName: product.manufacturer.customFields.nrbn_lvg_artist_lastname, media: product.manufacturer.media } not in manufacturers %}
  88.                 {% set manufacturers = manufacturers|merge([{ name: product.manufacturer.name, lastName: product.manufacturer.customFields.nrbn_lvg_artist_lastname, media: product.manufacturer.media }]) %}
  89.             {% endif %}
  90.         {% endfor %}
  91.         {% for letter in range('A', 'Z') %}
  92.             <div class="nr-manufacturer-listing-section">
  93.                 <div class="h2" id="nrManufacturerListingLetter{{ letter }}">{{ letter }}</div>
  94.                 <div class="row">
  95.                     {% for manufacturer in manufacturers|sort((a, b) => a.lastName <=> b.lastName) %}
  96.                         {% if manufacturer.lastName|first|upper == letter %}
  97.                             <div class="col-12 col-sm-6 col-md-4 col-lg-3">
  98.                                 <a class="nr-manufacturer-box" href="{{ seoUrl('frontend.nrbnlvg.manufacturer.detail', { manufacturer: manufacturer.name }) }}">
  99.                                     {% if manufacturer.media %}
  100.                                         {% sw_thumbnails 'manufacturer-box-image-thumbnails' with {
  101.                                             media: manufacturer.media,
  102.                                             attributes: {
  103.                                                 'class': 'nr-manufacturer-box-image img-fluid',
  104.                                                 'alt': manufacturer.name,
  105.                                             },
  106.                                             sizes: {
  107.                                                 'default': '800px'
  108.                                             }
  109.                                         } %}
  110.                                     {% endif %}
  111.                                     <div class="nr-manufacturer-box-overlay d-flex flex-column justify-content-end">
  112.                                         <h3 class="nr-manufacturer-box-title">{{ manufacturer.name }}</h3>
  113.                                     </div>
  114.                                 </a>
  115.                             </div>
  116.                         {% endif %}
  117.                     {% endfor %}
  118.                 </div>
  119.             </div>
  120.         {% endfor %}
  121.     {% else %}
  122.         {{ parent() }}
  123.     {% endif %}
  124. {% endblock %}