vendor/shopware/storefront/Resources/views/storefront/element/cms-element-manufacturer-logo.html.twig line 1

Open in your IDE?
  1. {% block element_manufacturer_logo %}
  2.     {% set config = element.translated.config %}
  3.     {% if element.data.manufacturer %}
  4.         {% set manufacturer = {
  5.             'media': element.data.manufacturer.media,
  6.             'name': element.data.manufacturer.translated.name,
  7.             'alt': element.data.manufacturer.translated.name,
  8.             'link': config.url.value ? config.url.value : element.data.manufacturer.link,
  9.         } %}
  10.     {% else %}
  11.         {% set manufacturer = {
  12.             'media': element.data.media,
  13.             'name': element.data.media.translated.title,
  14.             'alt': element.data.media.translated.alt,
  15.             'link': config.url.value,
  16.         } %}
  17.     {% endif %}
  18.     <div class="cms-element-image cms-element-{{ element.type }}{% if config.verticalAlign.value %} has-vertical-alignment{% endif %}">
  19.         {% block element_manufacturer_logo_inner %}
  20.             {% if config.verticalAlign.value %}
  21.                 <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 %}">
  22.             {% endif %}
  23.             {% block element_manufacturer_logo_link %}
  24.                 <a href="{{ manufacturer.link }}"
  25.                    class="cms-image-link product-detail-manufacturer-link"
  26.                    {% if config.newTab.value %}target="_blank" rel="noreferrer noopener"{% endif %}
  27.                    title="{{ manufacturer.name }}">
  28.                     {% if manufacturer.media %}
  29.                         <div class="cms-image-container is-{{ config.displayMode.value }}"
  30.                             {% if config.minHeight.value and config.displayMode.value == "cover" %} style="min-height: {{ config.minHeight.value }};"{% endif %}>
  31.                             {% block element_manufacturer_logo_image %}
  32.                                 {% set attributes = {
  33.                                     'class': 'cms-image product-detail-manufacturer-logo',
  34.                                     'alt': manufacturer.alt,
  35.                                     'title': manufacturer.name
  36.                                 } %}
  37.                                 {% if config.displayMode.value == 'cover' or config.displayMode.value == 'contain' %}
  38.                                     {% set attributes = attributes|merge({ 'data-object-fit': config.displayMode.value }) %}
  39.                                 {% endif %}
  40.                                 {% sw_thumbnails 'cms-image-thumbnails' with {
  41.                                     media: manufacturer.media
  42.                                 } %}
  43.                             {% endblock %}
  44.                         </div>
  45.                     {% else %}
  46.                         {% block element_manufacturer_logo_text %}
  47.                             {{ manufacturer.name }}
  48.                         {% endblock %}
  49.                     {% endif %}
  50.                 </a>
  51.             {% endblock %}
  52.             {% if config.verticalAlign.value %}
  53.                 </div>
  54.             {% endif %}
  55.         {% endblock %}
  56.     </div>
  57. {% endblock %}