custom/plugins/SalvanaPferde2022/src/Resources/views/storefront/component/product/card/box-product-motion-teaser-right.html.twig line 1

Open in your IDE?
  1. {% if product %}
  2.   {% set name = product.translated.name %}
  3.   {% set id = product.id %}
  4.   {% set cover = product.cover.media %}
  5.   {% if product.translated.customFields.wndev_motion_image %}
  6.       {% set motionImageID = product.translated.customFields.wndev_motion_image %}
  7.       {# fetch media as batch - optimized for performance #}
  8.       {% set mediaCollection = searchMedia([motionImageID], context.context) %}
  9.       {# extract single media object #}
  10.       {% set motionImage = mediaCollection.get(motionImageID) %}
  11.   {% endif %}
  12.   <div class="box-{{ layout }} col-12">
  13.     {% block component_product_box_content %}
  14.       <div class="card-body row">
  15.         {% block component_product_box_rich_snippets %}
  16.           {% sw_include '@Storefront/storefront/component/product/card/meta.html.twig' %}
  17.         {% endblock %}
  18.         {% block component_product_box_info %}
  19.           <div class="product-info col-12 col-md-5 col-xl-4">
  20.             {% block component_product_box_name %}
  21.               <a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
  22.                  class="product-name"
  23.                  title="{{ name }}">
  24.                 {{ name }}
  25.               </a>
  26.             {% endblock %}
  27.             <div class="row">
  28.               {% if product.translated.customFields.wndev_listing_text %}
  29.                 <div class="sub-title-wrapper col-12">
  30.                   <p class="sub-title m-0">{{ product.translated.customFields.wndev_listing_text }}</p>
  31.                 </div>
  32.               {% endif %}
  33.               {% if product.translated.customFields.wndev_listing_custom_list %}
  34.                 <div class="custom-listing-list-wrapper d-none d-sm-block col-12">
  35.                   {{ product.translated.customFields.wndev_listing_custom_list|raw }}
  36.                 </div>
  37.               {% endif %}
  38.             </div>
  39.             <div class="row">
  40.               {% if product.translated.customFields.wndev_vlog_badge %}
  41.                 <div class="col-6">
  42.                   <div class="vlog-badge-wrapper">
  43.                     {% set VlogBadgeID = product.translated.customFields.wndev_vlog_badge %}
  44.                     {# fetch media as batch - optimized for performance #}
  45.                     {% set mediaCollection = searchMedia([VlogBadgeID], context.context) %}
  46.                     {# extract single media object #}
  47.                     {% set VlogBadge = mediaCollection.get(VlogBadgeID) %}
  48.                     {% sw_thumbnails 'vlog-badge-listing' with {
  49.                       media: VlogBadge,
  50.                       attributes: {
  51.                         'class': 'vlog-badge-image',
  52.                         'alt': (VlogBadge.alt ?: ''),
  53.                         'title': (VlogBadge.title ?: ''),
  54.                         'data-object-fit': 'cover'
  55.                       }
  56.                     } %}
  57.                   </div>
  58.                 </div>
  59.               {% endif %}
  60.               <div class="col-6 col-lg-12">
  61.                 <div class="product-action text-right text-lg-left">
  62.                   <a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
  63.                      class="btn btn-primary"
  64.                      title="{{ "listing.boxProductDetails"|trans|striptags }}">
  65.                     {{ "listing.boxProductDetails"|trans|sw_sanitize }}
  66.                   </a>
  67.                 </div>
  68.               </div>
  69.             </div>
  70.           </div>
  71.         {% endblock %}
  72.         {% block component_product_box_image %}
  73.           <div class="product-image-wrapper col-12 d-flex"
  74.                {% if product.translated.customFields.wndev_motion_image %} style="background-image: url('{{ motionImage.url }}');"{% endif %}>
  75.             {% block component_product_box_badges %}
  76.               {% sw_include '@Storefront/storefront/component/product/card/badges.html.twig' %}
  77.             {% endblock %}
  78.             {# fallback if display mode is not set #}
  79.             {% set displayMode = displayMode ?: 'standard' %}
  80.             {# set display mode 'cover' for box-image with standard display mode #}
  81.             {% if layout == 'image' and displayMode == 'standard' %}
  82.               {% set displayMode = 'cover' %}
  83.             {% endif %}
  84.             <a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
  85.                title="{{ name }}"
  86.                class="product-image-link is-{{ displayMode }}">
  87.               {% if cover.url %}
  88.                 {% set attributes = {
  89.                   'class': 'product-image is-'~displayMode,
  90.                   'alt': (cover.translated.alt ?: name),
  91.                   'title': (cover.translated.title ?: name)
  92.                 } %}
  93.                 {% if displayMode == 'cover' or displayMode == 'contain' %}
  94.                   {% set attributes = attributes|merge({ 'data-object-fit': displayMode }) %}
  95.                 {% endif %}
  96.                 {% sw_thumbnails 'product-image-thumbnails' with {
  97.                   media: cover,
  98.                   sizes: {
  99.                     'xs': '501px',
  100.                     'sm': '315px',
  101.                     'md': '427px',
  102.                     'lg': '333px',
  103.                     'xl': '284px'
  104.                   }
  105.                 } %}
  106.               {% else %}
  107.                 <div class="product-image-placeholder">
  108.                   {% sw_icon 'placeholder' style {
  109.                     'size': 'fluid'
  110.                   } %}
  111.                 </div>
  112.               {% endif %}
  113.             </a>
  114.           </div>
  115.         {% endblock %}
  116.       </div>
  117.     {% endblock %}
  118.   </div>
  119. {% endif %}