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