custom/plugins/FourtwosixThemeExtension/src/Resources/views/storefront/element/fourtwosix-category-homepage.html.twig line 1

Open in your IDE?
  1. <div class="row cms-block-container-row row cms-row ">
  2. {# @fourtwosix-edit: rep is the #}
  3.     {% if data.repeat_column is defined and data.repeat_column is iterable %}
  4.         {# @fourtwosix-edit: These need to be defined only once #}
  5.         {% set attributes = {
  6.             'class': 'cms-image',
  7.             'data-object-fit': "cover",
  8.             'loading':"lazy"
  9.         } %}
  10.         {# @fourtwosix-edit: each repetition is a col with Text Image and Category Link #}
  11.         {% for element in data.repeat_column %}
  12.             {% set categoryLink = seoUrl('frontend.navigation.page', { navigationId:element.category.getId()}) %}
  13.             {% if element.media_category_background is defined and element.media_category_background is not null %}
  14.                 <div class="col-lg-4 col-md-6 pb-4">
  15.                     <div class="cms-element-image">
  16.                         {# @fourtwosix-edit: Link --------------------------- #}
  17.                         <a href="{{ categoryLink }}" class="cms-image-link text-decoration-none">
  18.                             <div class="cms-image-container is-cover d-flex align-items-center justify-content-center"
  19.                                  style="min-height: 340px;">
  20.                                 {# @fourtwosix-edit: Text ------------------- #}
  21.                                 {% if element.text_category_name is defined %}
  22.                                     <h5 class="d-inline-block text-over-image">{{ element.text_category_name }}</h5>
  23.                                 {% endif %}
  24.                                 {# @fourtwosix-edit: Image ------------------ #}
  25.                                 {% sw_thumbnails 'thumbnails' with {
  26.                                     media: element.media_category_background,
  27.                                 } %}
  28.                             </div>
  29.                         </a>
  30.                     </div>
  31.                 </div>
  32.             {% endif %}
  33.         {% endfor %}
  34.     {% endif %}
  35. </div>