templates/partials/_hero.html.twig line 1

Open in your IDE?
  1. {% set hero_classes = hero_classes ?? 'hero' %}
  2. {% set categories_list_id = categories_list_id ?? 'category-list' %}
  3. {% set hero_image = hero_image|default('') %}
  4. {% set hero_image_label = hero_image_label|default('Banniere') %}
  5. {% set hero_overlay = hero_overlay|default(false) %}
  6. {% set search_action = search_action ?? '#' %}
  7. {% set search_method = search_method is defined ? search_method : null %}
  8. {% set search_placeholder = search_placeholder ?? 'De quel produit avez-vous besoin?' %}
  9. {% set search_input_name = search_input_name is defined ? search_input_name : null %}
  10. {% set search_label = search_label ?? 'Recherche' %}
  11. {% set category_label_attr = category_label_attr ?? 'libelle' %}
  12. {% set category_label_raw = category_label_raw ?? false %}
  13. <section class="{{ hero_classes }}">
  14.     {% if page_title is defined %}
  15.         <h1 class="sr-only">{{ page_title }}</h1>
  16.     {% endif %}
  17.     <div class="container">
  18.         <div class="row hero__grid">
  19.             <div class="col-lg-3">
  20.                 <div class="hero__categories" aria-label="{{ categories_aria_label ?? 'Categories' }}">
  21.                     <button class="hero__categories__all" type="button" aria-expanded="true" aria-controls="{{ categories_list_id }}">
  22.                         <i class="fa fa-bars" aria-hidden="true"></i>
  23.                         <span>{{ categories_title ?? 'Categories' }}</span>
  24.                         <span class="hero__categories__caret" aria-hidden="true"></span>
  25.                     </button>
  26.                     <ul id="{{ categories_list_id }}">
  27.                         {% for item in categories ?? [] %}
  28.                             <li>
  29.                                 <h6>
  30.                                     {% if category_route_prefix is defined %}
  31.                                         <a href="{{ path(category_route_prefix ~ item.id) }}">
  32.                                             {% if category_label_raw %}
  33.                                                 {{ attribute(item, category_label_attr)|raw }}
  34.                                             {% else %}
  35.                                                 {{ attribute(item, category_label_attr)|e }}
  36.                                             {% endif %}
  37.                                         </a>
  38.                                     {% else %}
  39.                                         <a href="{{ path(category_route, { id: item.id }) }}">
  40.                                             {% if category_label_raw %}
  41.                                                 {{ attribute(item, category_label_attr)|raw }}
  42.                                             {% else %}
  43.                                                 {{ attribute(item, category_label_attr)|e }}
  44.                                             {% endif %}
  45.                                         </a>
  46.                                     {% endif %}
  47.                                 </h6>
  48.                             </li>
  49.                         {% endfor %}
  50.                     </ul>
  51.                 </div>
  52.             </div>
  53.             <div class="col-lg-9">
  54.                 <div class="hero__search">
  55.                     <div class="hero__search__form">
  56.                         <form action="{{ search_action }}"{% if search_method %} method="{{ search_method }}"{% endif %}>
  57.                             <label class="ch-visually-hidden" for="{{ search_input_id ?? 'hero-search-input' }}">{{ search_label }}</label>
  58.                             <div class="hero__search__categories">
  59.                                 {{ search_categories_label ?? 'Tous les Articles' }}
  60.                                 <span class="arrow_carrot-down"></span>
  61.                             </div>
  62.                             {% if partnership_cta_target is defined and partnership_cta_target %}
  63.                                 <a href="{{ partnership_cta_target }}" class="hero__partnership-btn"{% if partnership_cta_toggle is defined and partnership_cta_toggle %} data-toggle="{{ partnership_cta_toggle }}" data-target="{{ partnership_cta_target }}"{% endif %}>
  64.                                     <i class="fa fa-handshake-o" aria-hidden="true"></i>
  65.                                     <span>{{ partnership_cta_label ?? 'Demande de partenariat' }}</span>
  66.                                 </a>
  67.                             {% endif %}
  68.                             <input id="{{ search_input_id ?? 'hero-search-input' }}" type="text" placeholder="{{ search_placeholder }}"{% if search_input_name %} name="{{ search_input_name }}"{% endif %}>
  69.                             <button type="submit" class="site-btn ch-btn ch-btn--primary">{{ search_button_label ?? 'RECHERCHE' }}</button>
  70.                         </form>
  71.                     </div>
  72.                     <div class="hero__search__phone">
  73.                         <div class="hero__search__phone__icon" aria-hidden="true">
  74.                             <i class="fa fa-phone"></i>
  75.                         </div>
  76.                         <div class="hero__search__phone__text">
  77.                             <h5>{{ phone_number ?? '+225 07 09 00 57 32' }}</h5>
  78.                             <span>{{ phone_subtitle ?? 'support 24/7 time' }}</span>
  79.                         </div>
  80.                     </div>
  81.                 </div>
  82.                 <div class="hero__item set-bg" data-setbg="{{ hero_image }}" role="img" aria-label="{{ hero_image_label }}">
  83.                     {% if hero_overlay is defined and hero_overlay %}
  84.                         <div class="hero__overlay" aria-hidden="true"></div>
  85.                     {% endif %}
  86.                     {% if hero_content_template is defined and hero_content_template %}
  87.                         <div class="hero__content">
  88.                             {{ include(hero_content_template) }}
  89.                         </div>
  90.                     {% endif %}
  91.                 </div>
  92.             </div>
  93.         </div>
  94.     </div>
  95. </section>