custom/plugins/SwagHoggi/src/Resources/views/storefront/element/cms-element-image.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/element/cms-element-image.html.twig' %}
  2. {#
  3. {% block element_image %}
  4.     {% set config = element.fieldConfig.elements %}
  5.     <div class="cms-element-{{ element.type }}{% if config.verticalAlign.value %} has-vertical-alignment{% endif %}">
  6.         {% block element_product_slider_alignment %}
  7.             {% if config.verticalAlign.value %}
  8.                 <div class="cms-element-alignment{% if config.verticalAlign.value == "center" %} align-self-center{% elseif config.verticalAlign.value == "flex-end" %} align-self-end{% else %} align-self-start{% endif %}">
  9.             {% endif %}
  10.             {% block element_image_inner %}
  11.                 {% set imageElement %}
  12.                     {% block element_image_container %}
  13.                         {% if element.data.media.url %}
  14.                             <div class="cms-image-container is-{{ element.translated.config.displayMode.value }}"
  15.                                     {% if element.translated.config.minHeight.value and element.translated.config.displayMode.value == "cover" %} style="min-height: {{ element.translated.config.minHeight.value }};"{% endif %}>
  16.                                 {% block element_image_media %}
  17.                                     {% set attributes = {
  18.                                         'class': 'cms-image',
  19.                                         'alt': (element.data.media.translated.alt ?: ''),
  20.                                         'title': (element.data.media.translated.title ?: '')
  21.                                     } %}
  22.                                     {% if element.translated.config.displayMode.value == 'cover' or element.translated.config.displayMode.value == 'contain' %}
  23.                                         {% set attributes = attributes|merge({ 'data-object-fit': element.translated.config.displayMode.value }) %}
  24.                                     {% endif %}
  25.                                     {% sw_thumbnails 'cms-image-thumbnails' with {
  26.                                         media: element.data.media
  27.                                     } %}
  28.                                 {% endblock %}
  29.                             </div>
  30.                         {% endif %}
  31.                     {% endblock %}
  32.                 {% endset %}
  33.                 {% if element.translated.config.url.value %}
  34.                     <a href="{{ element.translated.config.url.value }}"
  35.                        class="cms-image-link"
  36.                        {% if element.translated.config.newTab.value %}target="_blank" rel="noopener"{% endif %}>
  37.                         {{ imageElement }}
  38.                     </a>
  39.                 {% else %}
  40.                     {{ imageElement }}
  41.                 {% endif %}
  42.             {% endblock %}
  43.             {% if config.verticalAlign.value %}
  44.                 </div>
  45.             {% endif %}
  46.         {% endblock %}
  47.     </div>
  48. {% endblock %} #}