templates/theme/default/partials/_header.html.twig line 1

Open in your IDE?
  1. {% set parametre = site_parameters.getParameters() %}
  2. {% set target = ['','_top','_new','_self','_blank','_parent'] %}
  3. {% import _self as macros %}
  4. <header class="modele-header-4 {{className}} {% if theme_option.headerbgtransparent %}transparent{% endif %}">
  5. <div class="header-principal">
  6. <div class="container-fluid content-wrapper">
  7. <div class="item-header row d-flex justify-content-between align-items-center">
  8. <div class="bloc-header-1 col col-lg-auto">
  9. <a href="{{app.request.schemeAndHttpHost ~ app.request.baseUrl}}" class="logo_h">
  10. <div class="logo">
  11. {% if theme_option.headerbgtransparent and parametre.imageheader is not empty %}
  12. <img class="img-logo" src="{{asset('/uploads/media-site/'~ parametre.image)}}" alt="{{parametre.titre}}" width="173" height="166" fetchpriority="high">
  13. {% elseif parametre.image is not empty %}
  14. <img src="{{asset('/uploads/media-site/'~ parametre.image)}}" alt="{{parametre.titre}}" width="173" height="166" fetchpriority="high">
  15. {% endif %}
  16. </div>
  17. </a>
  18. </div>
  19. <div class="item-menu-header col-auto d-flex justify-content-center align-items-center order-3 me-lg-4">
  20. <div class="bloc-header-2 col-auto">
  21. <div class="lists-items-header d-flex justify-content-end align-items-center flex-wrap" itemscope="">
  22. {% if socials is defined and socials is not empty %}
  23. <div class="socials-items d-sm-flex d-none">
  24. <div class="socials d-none">
  25. {% for item in socials %}
  26. {% if item.type == 1 %}
  27. <a href="{{item.url}}" title="{{item.titre}}" target="_blank">
  28. <i class="fa-brands fa-facebook-f"></i>
  29. </a>
  30. {% elseif item.type == 2 %}
  31. <a href="{{item.url}}" title="{{item.titre}}" target="_blank">
  32. <i class="fa-brands fa-x-twitter"></i>
  33. </a>
  34. {% elseif item.type == 3 %}
  35. <a href="{{item.url}}" title="{{item.titre}}" target="_blank">
  36. <i class="fa-brands fa-instagram"></i>
  37. </a>
  38. {% elseif item.type == 4 %}
  39. <a href="{{item.url}}" title="{{item.titre}}" target="_blank">
  40. <i class="fa-brands fa-linkedin-in"></i>
  41. </a>
  42. {% elseif item.type == 5 %}
  43. <a href="{{item.url}}" title="{{item.titre}}" target="_blank">
  44. <i class="fa-brands fa-youtube"></i>
  45. </a>
  46. {% elseif item.type == 6 %}
  47. <a href="{{item.url}}" title="{{item.titre}}" target="_blank">
  48. <i class="fa-brands fa-pinterest"></i>
  49. </a>
  50. {% elseif item.type == 7 %}
  51. <a href="{{item.url}}" title="{{item.titre}}" target="_blank">
  52. <i class="fa-brands fa-tiktok"></i>
  53. </a>
  54. {% endif %}
  55. {% endfor %}
  56. </div>
  57. </div>
  58. {% endif %}
  59. {% set phones = unserialize(contacts[0].tel) %}
  60. {% for key,item in phones %}
  61. <div class="item-tel-header d-none me-2">
  62. <a href="tel:{{stripNonNumeric(item)}}" class="tel phone-link" rel="nofollow">
  63. <i class="fa-solid fa-phone mr-2 "></i>
  64. <span>{{item}}</span>
  65. </a>
  66. </div>
  67. {% endfor %}
  68. <div class="cta bouton1-header d-sm-flex d-none me-lg-4">
  69. <button class="btn-header btn-theme" onclick="window.location.href = '{{resolveInternalSlugLink(4)}}';" title="{{ 'label.contact'|trans([],'textes') }}">{{ 'label.contact'|trans([],'textes') }}</button>
  70. </div>
  71. {% if parametre.actifbarserach %}
  72. <div class="dropdown search-bar">
  73. <button class="btn btn-outline-secondary" type="button" id="searchDropdown" data-bs-toggle="dropdown" aria-expanded="false">
  74. <i class="fas fa-search"></i>
  75. </button>
  76. <ul class="dropdown-menu dropdown-menu-end p-3" aria-labelledby="searchDropdown">
  77. <form class="d-flex" role="search" action="{{path('page',{slug:'search'})}}" method="GET">
  78. <input class="form-control me-2" type="search" name="search_keywords" placeholder="Rechercher..." aria-label="Rechercher">
  79. <button class="btn btn-theme" type="submit">Rechercher</button>
  80. <button class="btn btn-dark btn-mobile" type="submit">
  81. <i class="fas fa-search"></i>
  82. </button>
  83. </form>
  84. </ul>
  85. </div>
  86. {% endif %}
  87. {% if parametre.actifswitchlang %}
  88. <div class="switch-lang-mobile d-lg-block">
  89. {{ include ('theme/'~ app.request.server.get('APP_THEME') ~'/partials/_locale.html.twig',{}, with_context = false)}}
  90. </div>
  91. {% endif %}
  92. </div>
  93. </div>
  94. <div class="d-flex justify-content-center align-items-center box-menu me-lg-5">
  95. <div>
  96. <span class="title-menu d-none d-md-block">{{ 'label.menu'|trans([],'textes') }}</span>
  97. </div>
  98. <div class="d-flex flex-column align-items-center justify-content-center gap-1">
  99. <div class="burger-menu" id="burger-menu">
  100. <span class="line line1"></span>
  101. <span class="line line2"></span>
  102. <span class="line line3"></span>
  103. </div>
  104. </div>
  105. {% if menu_right is defined and menu_right is not empty %}
  106. <nav class="primary-nav menu" id="menu">
  107. <div class="cta-mobile bouton1-header d-block">
  108. <button class="btn-theme btn-header btn-nav" onclick="window.location.href = '{{resolveInternalSlugLink(4)}}';" title="{{ 'label.contact'|trans([],'textes') }}">{{ 'label.contact'|trans([],'textes') }}</button>
  109. </div>
  110. <ul>
  111. {{ macros.render_menu(menu_right, theme_option.actificonesnavigation, target) }}
  112. </ul>
  113. {% if socials is defined and socials is not empty %}
  114. <div class="socials-items d-none ">
  115. <div class="socials">
  116. {% for item in socials %}
  117. {% if item.type == 1 %}
  118. <a href="{{item.url}}" title="{{item.titre}}" target="_blank">
  119. <i class="fa-brands fa-facebook-f"></i>
  120. </a>
  121. {% elseif item.type == 2 %}
  122. <a href="{{item.url}}" title="{{item.titre}}" target="_blank">
  123. <i class="fa-brands fa-x-twitter"></i>
  124. </a>
  125. {% elseif item.type == 3 %}
  126. <a href="{{item.url}}" title="{{item.titre}}" target="_blank">
  127. <i class="fa-brands fa-instagram"></i>
  128. </a>
  129. {% elseif item.type == 4 %}
  130. <a href="{{item.url}}" title="{{item.titre}}" target="_blank">
  131. <i class="fa-brands fa-linkedin-in"></i>
  132. </a>
  133. {% elseif item.type == 5 %}
  134. <a href="{{item.url}}" title="{{item.titre}}" target="_blank">
  135. <i class="fa-brands fa-youtube"></i>
  136. </a>
  137. {% elseif item.type == 6 %}
  138. <a href="{{item.url}}" title="{{item.titre}}" target="_blank">
  139. <i class="fa-brands fa-pinterest"></i>
  140. </a>
  141. {% elseif item.type == 7 %}
  142. <a href="{{item.url}}" title="{{item.titre}}" target="_blank">
  143. <i class="fa-brands fa-tiktok"></i>
  144. </a>
  145. {% endif %}
  146. {% endfor %}
  147. </div>
  148. </div>
  149. {% endif %}
  150. {% set phones = unserialize(contacts[0].tel) %}
  151. {% for key,item in phones %}
  152. <div class="item-tel-header mb-2 d-none ">
  153. <a href="tel:{{stripNonNumeric(item)}}" class="tel phone-link" rel="nofollow">
  154. <i class="fa-solid fa-phone mr-2 "></i>
  155. <span>{{item}}</span>
  156. </a>
  157. </div>
  158. {% endfor %}
  159. </nav>
  160. {% endif %}
  161. </div>
  162. </div>
  163. </div>
  164. </div>
  165. </div>
  166. </header>
  167. {% macro render_menu(menu_items, use_icons, target) %}
  168. {% for menu in menu_items %}
  169. <li>
  170. <a title="{{ menu.title }}" href="{{ menu.path }}" {% if menu.nofollow %} rel="nofollow" {% endif %} target="{{ target[menu.target] }}" {% if menu.child is defined and menu.child is not empty %} class="toggle-submenu" {% endif %}>
  171. {% if use_icons %}
  172. {% if menu.icone %}
  173. <img src="{{ menu.icone }}" alt="{{ menu.title }}" class="icone"/>
  174. {% endif %}
  175. {% if menu.icone_hover %}
  176. <img src="{{ menu.icone_hover }}" alt="{{ menu.title }}" class="picto-hover"/>
  177. {% endif %}
  178. {% endif %}
  179. {{ menu.title }}
  180. </a>
  181. {% if menu.child is defined and menu.child is not empty %}
  182. <ul class="submenu">
  183. {{ _self.render_menu(menu.child, use_icons, target) }}
  184. </ul>
  185. {% endif %}
  186. </li>
  187. {% endfor %}
  188. {% endmacro %}