themes/BootstrapChildTheme/SyliusShopBundle/views/Taxon/_verticalMenu.html.twig line 1

Open in your IDE?
  1. {% if app.request.get('currentTaxonSlug') %}
  2.     {% set currentTaxon = get_taxon_by_slug(app.request.get('currentTaxonSlug'), sylius.localeCode) %}
  3. {% else %}
  4.     {% set currentTaxon = null %}
  5. {% endif %}
  6. {% macro item(taxon, isChild, currentTaxon = null) %}
  7.     {% import _self as macros %}
  8.     {% if taxon.enabledChildren|length > 0 %}
  9.         <li class="list-item">
  10.             <a class="list-link{% if currentTaxon and currentTaxon.root.id == taxon.root.id and (currentTaxon.left >= taxon.left and currentTaxon.right <= taxon.right) %} active{% endif %}" href="{{ path('sylius_shop_product_index', { 'slug': taxon.redirect ?: taxon.slug, '_locale': taxon.translation.locale }) }}" role="button">
  11.                 {{ taxon.name }}
  12.             </a>
  13.             <ul class="list">
  14.                 {% for childTaxon in taxon.enabledChildren %}
  15.                     {{ macros.item(childTaxon, true, currentTaxon) }}
  16.                 {% endfor %}
  17.             </ul>
  18.         </li>
  19.     {% else %}
  20.         <li class="list-item">
  21.             <a class="list-link{% if currentTaxon and currentTaxon.root.id == taxon.root.id and (currentTaxon.left >= taxon.left and currentTaxon.right <= taxon.right) %} active{% endif %}" href="{{ path('sylius_shop_product_index', { 'slug': taxon.redirect ?: taxon.slug, '_locale': taxon.translation.locale }) }}">
  22.                 {{ taxon.name }}
  23.             </a>
  24.         </li>
  25.     {% endif %}
  26. {% endmacro %}
  27. {% import _self as macros %}
  28. {% if taxons|length > 0 %}
  29.     <div class="sidenav mb-8">
  30.         <h3 class="sidenav-title">
  31.             <a class="link-heading" href="{{ path('sylius_shop_product_index', {'slug': taxons[0].redirect ?:  taxons[0].slug, '_locale': taxons[0].translation.locale}) }}">{{ taxons[0].parent.name }}</a>
  32.         </h3>
  33.         <div class="sidenav-list-wrap list">
  34.             <ul class="sidenav-list list">
  35.                 {% for taxon in taxons %}
  36.                     {{ macros.item(taxon, false, currentTaxon) }}
  37.                 {% endfor %}
  38.             </ul>
  39.         </div>
  40.     </div>
  41. {% endif %}