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: false,
  19.                         controls: sliderConfig.navigation.value ? true : false,
  20.                         autoplay: sliderConfig.rotate.value ? true : false
  21.                     }
  22.                 } %}
  23.                 {% if not sliderConfig.navigation.value %}
  24.                     {% set productSliderOptions = productSliderOptions|replace_recursive({
  25.                         slider: {
  26.                             mouseDrag: true
  27.                         }
  28.                     }) %}
  29.                 {% endif %}
  30.                 {% block element_product_slider_slider %}
  31.                     <div
  32.                         class="base-slider product-slider{% if sliderConfig.border.value %} has-border{% endif %}{% if sliderConfig.navigation.value %} has-nav{% endif %}"
  33.                         data-product-slider="true"
  34.                         data-product-slider-options="{{ productSliderOptions|json_encode }}">
  35.                         {% block element_product_slider_title %}
  36.                             {% if sliderConfig.title.value %}
  37.                                 <div class="cms-element-title">
  38.                                     <p class="cms-element-title-paragraph">{{ sliderConfig.title.value }}</p>
  39.                                 </div>
  40.                             {% endif %}
  41.                         {% endblock %}
  42.                         {% block element_product_slider_inner %}
  43.                             {% block element_product_slider_element %}
  44.                                 <div class="product-slider-container"
  45.                                      data-product-slider-container="true">
  46.                                     {% for product in element.data.products.elements %}
  47.                                         {% block element_product_slider_inner_item %}
  48.                                             <div class="product-slider-item">
  49.                                                 {% sw_include '@Storefront/storefront/component/product/card/box.html.twig' with {
  50.                                                     'layout': sliderConfig.boxLayout.value,
  51.                                                     'displayMode': sliderConfig.displayMode.value
  52.                                                 } %}
  53.                                             </div>
  54.                                         {% endblock %}
  55.                                     {% endfor %}
  56.                                 </div>
  57.                             {% endblock %}
  58.                             {% block element_product_slider_controls %}
  59.                                 {% if sliderConfig.navigation.value %}
  60.                                     <div class="product-slider-controls-container">
  61.                                         <div class="base-slider-controls"
  62.                                              data-product-slider-controls="true">
  63.                                             {% block element_product_slider_controls_items %}
  64.                                                 <button
  65.                                                     class="base-slider-controls-prev product-slider-controls-prev{% if sliderConfig.border.value %} has-border{% endif %}">
  66.                                                     {% block element_product_slider_controls_items_prev_icon %}
  67.                                                         {% sw_icon 'arrow-head-left' %}
  68.                                                     {% endblock %}
  69.                                                 </button>
  70.                                                 <button
  71.                                                     class="base-slider-controls-next product-slider-controls-next{% if sliderConfig.border.value %} has-border{% endif %}">
  72.                                                     {% block element_product_slider_controls_items_next_icon %}
  73.                                                         {% sw_icon 'arrow-head-right' %}
  74.                                                     {% endblock %}
  75.                                                 </button>
  76.                                             {% endblock %}
  77.                                         </div>
  78.                                     </div>
  79.                                 {% endif %}
  80.                             {% endblock %}
  81.                         {% endblock %}
  82.                     </div>
  83.                 {% endblock %}
  84.                 {% if config.verticalAlign.value %}
  85.                     </div>
  86.                 {% endif %}
  87.             {% endblock %}
  88.         </div>
  89.     {% endif %}
  90. {% endblock %}