custom/plugins/AtcCustom/src/Resources/views/storefront/element/cms-element-oo-categorybox-2.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@parent/storefront/element/cms-element-oo-categorybox-2.html.twig' %}
  2. {% block element_oo_categoryhighlight %}
  3.         <div class="oo-category-highlight">
  4.             {#{% for i in 1..3 %}#}
  5.             {% set i = 1 %}
  6.             {% set img_id = element.config['cat' ~ i ~ 'image'].value %}
  7.             {% set cat_id = element.config['cat' ~ i ~ 'category'].value %}
  8.             {% set alt_text = element.config['cat' ~ i ~ 'text'].value %}
  9.             {% set alt_url = element.config['cat' ~ i ~ 'url'].value %}
  10.             {% set media = img_id ? searchMedia([img_id], context.context) : '' %}
  11.             {% set category = page.cmsPage.extensions.categories.elements[cat_id] %}
  12.             {% block element_oo_categoryhighlight_item %}
  13.                 <a {% if category %}href="{{ alt_url ? alt_url : seoUrl('frontend.navigation.page', { navigationId: category.id }) }}{% endif %}" class="col-12 d-flex flex-row justify-content-between mr-2 p-0 oo-category-highlight-item">
  14.                     <div class="oo-cat-image mt-auto mb-auto mr-2" style="">
  15.                         {% if media %}
  16.                             {% sw_thumbnails 'sibling-cover-thumbnails' with {
  17.                                 media: media.first(),
  18.                                 sizes: {
  19.                                     'default': '75px'
  20.                                 },
  21.                                 attributes: {
  22.                                     'style': 'width:100%;',
  23.                                     'alt': (category.translated.name ?: category.translated.name),
  24.                                 }
  25.                             } %}
  26.                         {% endif %}
  27.                     </div>
  28.                     <div class="oo-cat-name pl-4 pr-4 m-md-auto">
  29.                         {{ alt_text ? alt_text : (category.translated.name ?: category.translated.name) }}
  30.                     </div>
  31.                 </a>
  32.             {% endblock %}
  33. {#{% endfor %}#}
  34.         </div>
  35. {% endblock %}