templates/includes/teaser/products-teaser-product.html.twig line 1

Open in your IDE?
  1. {% set brickAttributes = product.getTeaserAttributes() %}
  2. {% set teaserAttribute1 = brickAttributes['attribute1']|default(null) %}
  3. {% set teaserAttribute2 = brickAttributes['attribute2']|default(null) %}
  4. <article class="product-teaser shadow stretch-link border-radius-4">
  5.     <div class="product-teaser__container-img">
  6.         <div class="ratio ratio-4x3">
  7.             {% if product.mainImage %}
  8.                 {{ product.mainImage.getThumbnail('product-teaser').getHTML({
  9.                     imgAttributes: {
  10.                         'class': 'ratio-item js-lazy-img product-teaser__img'
  11.                     },
  12.                     'lowQualityPlaceholder': true
  13.                 })|raw }}
  14.             {% endif %}
  15.         </div>
  16.     </div>
  17.     <div class="product-teaser__content">
  18.         <div class="d-flex flex-column">
  19.             <span class="product-teaser__title">{{ 'product.teaser.Model'|trans }}</span>
  20.             {% if product.brand %}
  21.                 <span class="product-teaser__data product-teaser__data--bold">
  22.                     {{ (product.brand.title ?: product.brand.internalBrandName) ~ ' ' ~ product.title }}
  23.                 </span>
  24.             {% endif %}
  25.         </div>
  26.         <div class="product-teaser__container d-flex">
  27.             {% for key, attribute in brickAttributes %}
  28.                 {% if attribute %}
  29.                     <div class="{{ loop.index != 1 ? 'product-teaser__info-right' }} flex-column d-flex">
  30.                         <div class="d-flex flex-column pe-2">
  31.                             <span class="product-teaser__title">{{ ('product.detail.' ~ key)|trans }}</span>
  32.                             {% set tk_prefix = '' %}
  33.                             {% set internalBrand = internalBrand ?? product.internalBrand ?? '' %}
  34.                             {% if key == 'manual.throughput' %}
  35.                                 {% set tk_prefix = 'product.detail.' ~ internalBrand ~ ".throughput" ~ '-prefix' %}
  36.                             {% endif %}
  37.                             <span class="product-teaser__data">
  38.                                 {{ ((tk_prefix == tk_prefix|trans) and (not app.request.get('pimcore_debug_translations'))) ? '' : document.property('swiss') ? (tk_prefix|trans)|replace({'ß': 'ss'})|raw : tk_prefix|trans|raw }}
  39.                                 {{ attribute }} {{ ('product.detail.' ~ key ~ '-suffix')|trans }}
  40.                             </span>
  41.                         </div>
  42.                     </div>
  43.                 {% endif %}
  44.             {% endfor %}
  45.         </div>
  46.         <div class="product-teaser__container-link d-flex">
  47.             <a class="text-gradient-primary product-teaser__category">{{ product.category.getDisplayTitle(app.request.locale) ?? product.category.getTitle(app.request.locale) }}</a>
  48.             <a href="{{ linkGenerator(product) }}"
  49.                class="btn btn-dark stretch-link__link"
  50.                data-event-tracking-event="select_product"
  51.                data-event-tracking-product_brand=" {{ product.brand.title ?: product.brand.internalBrandName }}"
  52.                data-event-tracking-product_variant="{{ product.title }}"
  53.                data-event-tracking-product_category="{{ product.category.getDisplayTitle(app.request.locale) ?? product.category.getTitle(app.request.locale) }}"
  54.                data-event-tracking-link_url="{{ elements_host_url() ~  linkGenerator(product) }}">
  55.                 {{ 'product.teaser.Detail'|trans }}
  56.             </a>
  57.         </div>
  58.     </div>
  59. </article>