themes/BootstrapTheme/templates/bundles/SyliusShopBundle/Homepage/_indexFlagshipTaxons.html.twig line 1

Open in your IDE?
  1. {% import "@SyliusShop/Common/Macro/icons.html.twig" as icons %}
  2. {% macro item(taxon, isChild) %}
  3.     {% import _self as macros %}
  4.     {% if taxon.children|length > 0 %}
  5.         <div class="{% if isChild <= 2 %}col-sm-6 {% else %}col-sm-4 {% endif %} col-12 mb-md-5 mb-3 px-md-4 px-sm-3 px-2 wow fadeIn" {{ sylius_test_html_attribute('menu-item') }}>
  6.             <div class="h-100 category-item-index flex-column d-flex">
  7.                 <div class="category-item-img mx-sm-0 mx-n3">
  8.                     {% if taxon.images.first %}
  9.                             {% set path = taxon.images.first.path|imagine_filter(filter|default('app_shop_taxon_show_index')) %}
  10.                     {% else %}
  11.                         {% set path = asset('images/imgcateg_i1.jpg') %}
  12.                     {% endif %}
  13.                         <a href="{{ path('sylius_shop_product_index', {'slug': taxon.slug, '_locale': taxon.translation.locale, 'id': taxon.oldId}) }}" title="{{ taxon.name }}"><img src="{{ path }}" alt="{{ taxon.name }}" class="w-100" /></a>
  14.                 </div>
  15.                 <h3 class="category-item-lib"><a href="{{ path('sylius_shop_product_index', {'slug': taxon.slug, '_locale': taxon.translation.locale, 'id': taxon.oldId}) }}" title="{{ taxon.name }}">{{ taxon.name }}</a></h3>
  16.                 <div class="flex-grow-l_ text-grey category-item-desc">
  17.                     <p class="mb-1">{{ taxon.description|raw }}</p>
  18.                 </div>
  19.                 <div class="">
  20.                     <ul class="row mx-n2 list-unstyled mb-0">
  21.                         {% for childTaxon in taxon.children %}
  22.                         <li class="{% if isChild <= 2 %}col-md-6 col-sm-12 col-6 {% else %}col-sm-12 col-6{% endif %} px-2 "><a href="{{ path('sylius_shop_product_index', {'slug': childTaxon.slug, '_locale': childTaxon.translation.locale, 'id': childTaxon.oldId}) }}" title="{{ childTaxon.name }}">> <span>{{ childTaxon.name }}</span></a></li>
  23.                         {% endfor %}
  24.                     </ul>
  25.                 </div>
  26.             </div>
  27.         </div>
  28.     {% else %}
  29.          <div class="{% if isChild <= 2 %}col-sm-6 {% else %}col-sm-4 {% endif %} col-12 mb-md-5 mb-3 px-md-4 px-sm-3 px-2 wow fadeIn">
  30.             <div class="h-100 category-item-index flex-column d-flex">
  31.                 <div class="category-item-img mx-sm-0 mx-n3">
  32.                     {% if taxon.images.first %}
  33.                             {% set path = taxon.images.first.path|imagine_filter(filter|default('app_shop_taxon_show_index')) %}
  34.                     {% else %}
  35.                         {% set path = asset('images/imgcateg_i1.jpg') %}
  36.                     {% endif %}
  37.                         <a href="{{ path('sylius_shop_product_index', {'slug': taxon.slug, '_locale': taxon.translation.locale, 'id': taxon.oldId}) }}"  title="{{ taxon.name }}"><img src="{{ path }}" alt="{{ taxon.name }}" class="w-100" /></a>
  38.                 </div>
  39.                 <h3 class="category-item-lib"><a href="{{ path('sylius_shop_product_index', {'slug': taxon.slug, '_locale': taxon.translation.locale, 'id': taxon.oldId}) }}" title="{{ taxon.name }}">{{ taxon.name }}</a></h3>
  40.                 <div class="flex-grow-l text-grey">
  41.                     <p class="mb-1">{{ taxon.description|raw }}</p>
  42.                 </div>
  43.                 <div class="">
  44.                     <ul class="row mx-n2 list-unstyled mb-0">
  45.                         {% for childTaxon in taxon.children %}
  46.                             <li class="{% if isChild <= 2 %}col-md-6 col-sm-12 col-6 {% else %}col-sm-12 col-6{% endif %} px-2 "><a href="{{ path('sylius_shop_product_index', {'slug': childTaxon.slug, '_locale': childTaxon.translation.locale, 'id': childTaxon.oldId}) }}" title="{{ childTaxon.name }}">> <span>{{ childTaxon.name }}</span></a></li>
  47.                         {% endfor %}
  48.                     </ul>
  49.                 </div>
  50.             </div>
  51.         </div>
  52.     {% endif %}
  53. {% endmacro %}
  54. {% import _self as macros %}
  55. {% if taxons|length > 0 %}
  56.     <section class="bloc-category-index px-md-3 px-2  pb-md-0 pt-4 pb-2 mt-2 ">
  57.         <div class="max-container-5 px-0">
  58.             <h2 class="title-medium color-black text-center">{{'app.homepage.our_categories'|trans}}</h2>
  59.             <div class="row mx-xl-n4 mx-sm-n3 mx-n2 pt-2 pt-md-3">
  60.                 {% for taxon in taxons %}
  61.                     {{ macros.item(taxon, loop.index) }}
  62.                 {% endfor %}
  63.             </div>
  64.         </div>
  65.     </section>
  66. {% endif %}