vendor/shopware/storefront/Resources/views/storefront/element/cms-element-product-slider.html.twig line 1

Open in your IDE?
  1. {% block element_product_slider %}
  2.     {% if not sliderConfig %}
  3.         {% set sliderConfig = element.fieldConfig.elements %}
  4.     {% endif %}
  5.     {% if element.data.products.elements %}
  6.         <div
  7.             class="cms-element-{{ element.type }}{% if sliderConfig.displayMode.value == "standard" and sliderConfig.verticalAlign.value %} has-vertical-alignment{% endif %}">
  8.             {% block element_product_slider_alignment %}
  9.                 {% if config.verticalAlign.value %}
  10.                     <div class="cms-element-alignment{% if sliderConfig.verticalAlign.value == "center" %} align-self-center{% elseif sliderConfig.verticalAlign.value == "flex-end" %} align-self-end{% else %} align-self-start{% endif %}">
  11.                 {% endif %}
  12.                 {% set productSliderOptions = {
  13.                     productboxMinWidth: sliderConfig.elMinWidth.value ? sliderConfig.elMinWidth.value : '',
  14.                     slider: {
  15.                         gutter: 30,
  16.                         autoplayButtonOutput: false,
  17.                         nav: false,
  18.                         mouseDrag: sliderConfig.navigation.value ? false : true,
  19.                         controls: sliderConfig.navigation.value ? true : false,
  20.                         autoplay: sliderConfig.rotate.value ? true : false
  21.                     }
  22.                 } %}
  23.                 {% block element_product_slider_slider %}
  24.                     <div
  25.                         class="base-slider product-slider{% if sliderConfig.border.value %} has-border{% endif %}{% if sliderConfig.navigation.value %} has-nav{% endif %}"
  26.                         data-product-slider="true"
  27.                         data-product-slider-options="{{ productSliderOptions|json_encode }}">
  28.                         {% block element_product_slider_title %}
  29.                             {% if sliderConfig.title.value %}
  30.                                 <div class="cms-element-title">
  31.                                     <p class="cms-element-title-paragraph">{{ sliderConfig.title.value }}</p>
  32.                                 </div>
  33.                             {% endif %}
  34.                         {% endblock %}
  35.                         {% block element_product_slider_inner %}
  36.                             {% block element_product_slider_element %}
  37.                                 <div class="product-slider-container"
  38.                                      data-product-slider-container="true">
  39.                                     {% for product in element.data.products.elements %}
  40.                                         {% block element_product_slider_inner_item %}
  41.                                             <div class="product-slider-item">
  42.                                                 {% sw_include '@Storefront/storefront/component/product/card/box.html.twig' with {
  43.                                                     'layout': sliderConfig.boxLayout.value,
  44.                                                     'displayMode': sliderConfig.displayMode.value
  45.                                                 } %}
  46.                                             </div>
  47.                                         {% endblock %}
  48.                                     {% endfor %}
  49.                                 </div>
  50.                             {% endblock %}
  51.                             {% block element_product_slider_controls %}
  52.                                 {% if sliderConfig.navigation.value %}
  53.                                     <div class="product-slider-controls-container">
  54.                                         <div class="base-slider-controls"
  55.                                              data-product-slider-controls="true">
  56.                                             {% block element_product_slider_controls_items %}
  57.                                                 <button
  58.                                                     class="base-slider-controls-prev product-slider-controls-prev{% if sliderConfig.border.value %} has-border{% endif %}">
  59.                                                     {% block element_product_slider_controls_items_prev_icon %}
  60.                                                         {% sw_icon 'arrow-head-left' %}
  61.                                                     {% endblock %}
  62.                                                 </button>
  63.                                                 <button
  64.                                                     class="base-slider-controls-next product-slider-controls-next{% if sliderConfig.border.value %} has-border{% endif %}">
  65.                                                     {% block element_product_slider_controls_items_next_icon %}
  66.                                                         {% sw_icon 'arrow-head-right' %}
  67.                                                     {% endblock %}
  68.                                                 </button>
  69.                                             {% endblock %}
  70.                                         </div>
  71.                                     </div>
  72.                                 {% endif %}
  73.                             {% endblock %}
  74.                         {% endblock %}
  75.                     </div>
  76.                 {% endblock %}
  77.                 {% if config.verticalAlign.value %}
  78.                     </div>
  79.                 {% endif %}
  80.             {% endblock %}
  81.         </div>
  82.     {% endif %}
  83. {% endblock %}