templates/decor/includes/decor-teaser.html.twig line 1

Open in your IDE?
  1. {% set styleModifier = styleModifier | default('') %}
  2. {% set classNames = {
  3.     main: main | default('')
  4. } | merge(classNames | default({})) %}
  5. <section class="product-teaser {{ styleModifier }} {{ attribute(classNames, 'main') }} product-teaser--decor stretch-link">
  6.     <div class="product-teaser__image">
  7.         {% if decor.isNew and (not decor.newUntilDate or dateIsCurrent(decor.newUntilDate))%}
  8.         <div class="ribbon-new__container-overview">
  9.         {% endif %}
  10.             <div class="ratio ratio-73x52">
  11.                 {% set image = decor.teaserImage %}
  12.                 {% if image %}
  13.                     {{ image.thumbnail('product-teaser').html({imgAttributes:{
  14.                         class:'js-lazy-img ratio-item'
  15.                     },
  16.                         lowQualityPlaceholder:true})|raw }}
  17.                 {% endif %}
  18.             </div>
  19.             {% if decor.isNew and (not decor.newUntilDate or dateIsCurrent(decor.newUntilDate))%}
  20.                 <div class="ribbon-new__ribbon ribbon-new__ribbon--overview">
  21.                     {{ 'badge.neu' | trans }}
  22.                 </div>
  23.         </div>
  24.             {% endif %}
  25.     </div>
  26.     <div class="product-teaser__body">
  27.         <div class="product-teaser__body-top mb-md-4 mb-3">
  28.             {% if not hideApplicationAreas|default(false) %}
  29.                 <div class="product-teaser__supline">
  30.                     {% if decor.applicationAreas is empty %}
  31.                         {{ 'global.univeral'|trans }}
  32.                     {% endif %}
  33.                     {% if decor.applicationAreas is not empty %}
  34.                         {{ decor.applicationAreas | map(a => "#{a.title}") | join(' | ') }}
  35.                     {% endif %}
  36.                     {% if decor.decorGroup and decor.decorGroup.title %}
  37.                         | {{ decor.decorGroup.title }}
  38.                     {% endif %}
  39.                 </div>
  40.             {% endif %}
  41.             <h2 class=" product-teaser__headline">
  42.                 <a href="{{ pimcore_url({object: decor}) }}" class="stretch-link__link">{{ decor.decorNr ~ ' ' ~ (decor.webTitle ?: decor.title) }}</a>
  43.             </h2>
  44.         </div>
  45.         <div class="product-teaser__body-bottom mt-auto">
  46.             <ul class="product-teaser__properties-list">
  47.                 {% if decor.ncsCode %}
  48.                     <li class="product-teaser__property">
  49.                         NCS {{ decor.ncsCode }}
  50.                     </li>
  51.                 {% endif %}
  52.                 {% if decor.ralNr %}
  53.                     <li class="product-teaser__property">
  54.                         RAL {{ decor.ralNr }}
  55.                     </li>
  56.                 {% endif %}
  57.                 {% if decor.colorCode %}
  58.                     <li class="product-teaser__property">
  59.                         CMYK {{ decor.colorCode }}
  60.                     </li>
  61.                 {% endif %}
  62.             </ul>
  63.         </div>
  64.     </div>
  65. </section>