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

Open in your IDE?
  1. {% block element_oo_categoryhighlight %}
  2.         <div class="oo-category-highlight">
  3.             {#{% for i in 1..3 %}#}
  4.             {% set i = 1 %}
  5.             {% set img_id = element.config['cat' ~ i ~ 'image'].value %}
  6.             {% set cat_id = element.config['cat' ~ i ~ 'category'].value %}
  7.             {% set alt_text = element.config['cat' ~ i ~ 'text'].value %}
  8.             {% set alt_url = element.config['cat' ~ i ~ 'url'].value %}
  9.             {% set media = img_id ? searchMedia([img_id], context.context) : '' %}
  10.             {% set category = page.cmsPage.extensions.categories.elements[cat_id] %}
  11.             {% block element_oo_categoryhighlight_item %}
  12.                 <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 border border-dark rounded mr-2 p-0 oo-category-highlight-item">
  13.                     <div class="oo-cat-image mt-auto mb-auto mr-2" style="">
  14.                         {% if media %}
  15.                             {% sw_thumbnails 'sibling-cover-thumbnails' with {
  16.                                 media: media.first(),
  17.                                 sizes: {
  18.                                     'default': '75px'
  19.                                 },
  20.                                 attributes: {
  21.                                     'style': 'width:100%;',
  22.                                     'alt': (category.translated.name ?: category.translated.name),
  23.                                 }
  24.                             } %}
  25.                         {% endif %}
  26.                     </div>
  27.                     <div class="oo-cat-name pl-4 pr-4 font-weight-bold text-dark m-md-auto">
  28.                         {{ alt_text ? alt_text : (category.translated.name ?: category.translated.name) }}
  29.                     </div>
  30.                 </a>
  31.             {% endblock %}
  32. {#{% endfor %}#}
  33.         </div>
  34. {% endblock %}