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

Open in your IDE?
  1. <article class="product-category-teaser stretch-link shadow border-radius-8">
  2.     {% if categoryTeaser.image is not empty %}
  3.         <div class="product-category-teaser__img-container">
  4.             <div class="ratio ratio-4x3">
  5.                 {{ categoryTeaser.image.thumbnail('product-category').getHtml({
  6.                     imgAttributes: {
  7.                         class: 'ratio-item js-lazy-img product-category__img',
  8.                     },
  9.                     lowQualityPlaceholder: true,
  10.                 })|raw }}
  11.             </div>
  12.         </div>
  13.     {% endif %}
  14.     <div class="product-category-teaser__content">
  15.         {% set link = '#' %}
  16.         {% set description = '' %}
  17.         {% if categoryTeaser.relation %}
  18.             {% set link = categoryTeaser.relation.fullpath %}
  19.             {% set description = categoryTeaser.teaserDescription ?: categoryTeaser.description %}
  20.         {% endif %}
  21.         {% if categoryTeaser.countryRelations %}
  22.             {% for blockElement in categoryTeaser.countryRelations %}
  23.                 {% if blockElement.config.data and blockElement.config.data.country == siteConfig().country %}
  24.                     {% if blockElement.countryRelation.data %}
  25.                         {% set link = blockElement.countryRelation.data.fullpath %}
  26.                     {% endif %}
  27.                     {% if blockElement.countryTeaserDescription.data %}
  28.                         {% set description = blockElement.countryTeaserDescription.data %}
  29.                     {% endif %}
  30.                 {% endif %}
  31.             {% endfor %}
  32.         {% endif %}
  33.         <h3 class="category-teaser__link">
  34.                 <span class="text-gradient-primary category-teaser__category">
  35.                     <a href="{{ link }}"
  36.                        class="stretch-link__link d-flex align-items-center justify-content-between w-100">
  37.                         {{ categoryTeaser.getDisplayTitle() ?: categoryTeaser.getTitle() }}
  38.                     </a>
  39.                 </span>
  40.             <span aria-hidden="true" class="icon icon-arrow"></span>
  41.         </h3>
  42.         {% if description is defined and description is not empty %}
  43.             <div class="category-teaser__info">{{ description|raw }}</div>
  44.         {% endif %}
  45.     </div>
  46. </article>