templates/bundles/SyliusShopBundle/Taxon/_horizontalMenu.html.twig line 1

Open in your IDE?
  1. {% macro item(taxon) %}
  2.     {% import _self as macros %}
  3.     {% set children = taxon.getEnabledChildrenByTranslationName(taxon.translation.locale) %}
  4.     {% if children|length > 0 %}
  5.         <div class="ui simple dropdown item">
  6.                         <a href="{{ path('bitbag_sylius_elasticsearch_plugin_shop_list_products', {'slug': taxon.slug, 'products':'products'|trans, 'product_category':'product_category'|trans, '_locale': taxon.translation.locale}) }}" data-js="menu-link" class="menu-dropdown-link">
  7.                 <span class="text text-sm">{{ taxon.name }}</span>
  8.                 <span class="material-symbols-outlined">expand_more</span>
  9.             </a>
  10.             <div class="menu hyfindr-column-menu" {% if children|length < 12 %}style="grid-template-rows: repeat({{ taxon.enabledChildren|length }}, 1fr)"{% endif %}>
  11.                 {% for childTaxon in children %}
  12.                     {{ macros.nested_item(childTaxon) }}
  13.                 {% endfor %}
  14.             </div>
  15.         </div>
  16.     {% else %}
  17.         <a href="{{ path('bitbag_sylius_elasticsearch_plugin_shop_list_products', {'slug': taxon.slug, 'products':'products'|trans, 'product_category':'product_category'|trans, '_locale': taxon.translation.locale}) }}" class="item text text-sm">{{ taxon.name }}</a>
  18.     {% endif %}
  19. {% endmacro %}
  20. {% macro nested_item(taxon) %}
  21.     {% import _self as macros %}
  22.     {% set children = taxon.getEnabledChildrenByTranslationName(taxon.translation.locale) %}
  23.     {% if children|length > 0 %}
  24.             <div class="item nested_item">
  25.                 <a href="{{ path('bitbag_sylius_elasticsearch_plugin_shop_list_products', {'slug': taxon.slug, 'products':'products'|trans, 'product_category':'product_category'|trans, '_locale': taxon.translation.locale}) }}">
  26.                     <span class="text">{{ taxon.name }}</span>
  27.                     <span class="material-symbols-outlined">expand_more</span>
  28.                 </a>
  29.                 <div class="menu right hyfindr-column-menu" {% if children|length < 12 %}style="grid-template-rows: repeat({{ taxon.enabledChildren|length }}, 1fr)"{% endif %}>
  30.                     {% for childTaxon in children %}
  31.                         {{ macros.nested_item(childTaxon) }}
  32.                     {% endfor %}
  33.                 </div>
  34.             </div>
  35.     {% else %}
  36.         <a href="{{ path('bitbag_sylius_elasticsearch_plugin_shop_list_products', {'slug': taxon.slug, 'products':'products'|trans, 'product_category':'product_category'|trans, '_locale': taxon.translation.locale}) }}" class="item nested_item text text-sm">{{ taxon.name }}</a>
  37.     {% endif %}
  38. {% endmacro %}
  39. {% import _self as macros %}
  40. {% set registerProductsLink = url('bitbag_sylius_organization_plugin_shop_register_organization_vendor') %}
  41. {% if is_granted('ROLE_USER') %}
  42.     {% if app.user.customer.organization.vendor|default(null) == null %}
  43.         {% set registerProductsLink = url('open_marketplace_vendor_register_form') %}
  44.     {% else %}
  45.         {% set registerProductsLink = url('open_marketplace_vendor_product_listings_index') %}
  46.     {% endif %}
  47. {% endif %}
  48. <div class="menu-bar desktop-menu">
  49.     {% if taxons|length > 0 %}
  50.         <div class="ui large stackable menu horizontal-menu">
  51.             {% if get_current_route_name() not in ['app_tech_videos', 'app_tech_advisory', 'app_tech_knowledge'] %}
  52.                 {% for taxon in taxons if true == taxon.enabled %}
  53.                     {{ macros.item(taxon) }}
  54.                 {% endfor %}
  55.                 {{ render(path('open_marketplace_shop_render_country_menu', {'template': 'Context/Shop/Menu/country.html.twig'})) }}
  56.                 {{ render(path('open_marketplace_shop_render_use_case_menu', {'template': 'Context/Shop/Menu/useCases.html.twig'})) }}
  57.                 <a href="{{ path('open_marketplace_shop_vendor_index') }}" class="item text-sm">{{ 'app.ui.brands'|trans }}</a>
  58.             {% elseif get_current_route_name() == 'app_tech_videos' %}
  59.                 {% include 'Context/TechVideos/horizontalMenu.html.twig' %}
  60.             {% elseif get_current_route_name() == 'app_tech_advisory' %}
  61.                 {% include 'Context/TechAdvisory/horizontalMenu.html.twig' %}
  62.             {% elseif get_current_route_name() == 'app_tech_knowledge' %}
  63.                 {% include 'Context/TechKnowledge/horizontalMenu.html.twig' %}
  64.             {% endif %}
  65.         </div>
  66.     {% endif %}
  67.     <a href="{{ registerProductsLink }}" class="hyfindr btn btn--primary header-button capitalize">{{  'app.ui.register_products'|trans }}</a>
  68. </div>