templates/front/theme1/partials/_navbar.html.twig line 1

Open in your IDE?
  1. {% set path_href = '/' %}
  2. <label for="menu-handler"><span></span><span></span><span></span></label>
  3. {% if menu_right %}
  4.     <nav class="primary-nav">
  5.         <ul>
  6.         {% for key,menu in menu_right %}
  7.                 {% if menu.type == 'aucun' %}
  8.                     {% set path_href = '#' %}       
  9.                 {% elseif menu.type == 'lien' %}
  10.                     {% set path_href = menu.url %}
  11.                 {% elseif menu.type == 'categorie' or menu.type == 'sous-categorie' or menu.type == 'Post' %}
  12.                     {% set path_href = path('page',{slug:menu.slug}) %}
  13.                 {% elseif menu.type == 'categorie-product' %}
  14.                     {% set path_href = path('list_produit',{slug:menu.slug}) %}
  15.                 {% elseif menu.type == 'list-faq' %}
  16.                     {% set path_href = path('list_faq',{slug:menu.slug}) %}
  17.                 {% elseif menu.type == 'plan-du-site'%}
  18.                     {% set path_href = path('plan_du_site') %}
  19.                 {% elseif menu.type == 'hub-activite' %}
  20.                     {% set path_href = path('page_activites') %}
  21.                 {% elseif menu.type == 'hub-localite' %}
  22.                     {% set path_href = path('page_localite') %}
  23.                 {% elseif menu.type == 'hub-actualite' %}
  24.                     {% set path_href = path('page_nos_actualites') %}
  25.                 {% elseif menu.type == 'activite_principal' %}
  26.                     {% set path_href = path('page',{slug:menu.slug}) %} 
  27.                 {% elseif menu.type == 'secteur' %}
  28.                     {% set path_href = path('page_details_localite',{slug:menu.slug}) %}
  29.                 {% endif %} 
  30.                 {% if menu.child %}
  31.                         <li><a title="{{menu.title}}" href="{{path_href}}"  {% if menu.nofollow == true %}rel="nofollow"{% endif %} target="{{target[menu.target]}}">
  32.                         {% if iconesNavigation %}
  33.                         
  34.                             {% if menuDetails[key].icone is not empty %}
  35.                                 <img src="{{menuDetails[key].icone}}" alt="{{menu.title}}" class="icone" />
  36.                             {% endif %}
  37.                             {% if menuDetails[key].iconehover is not empty %}
  38.                                 <img src="{{menuDetails[key].iconehover}}" alt="{{menu.title}}" class="picto-hover" />
  39.                             {% endif %}
  40.                         {% endif %}
  41.                         
  42.                         {{menu.title}}</a>
  43.                             <ul>
  44.                             {% for item in menu.child %}
  45.                                 {% if item.type == 'aucun' %}
  46.                                     {% set path_child_href = '#' %}       
  47.                                 {% elseif item.type == 'lien' %}
  48.                                     {% set path_child_href = item.url %}
  49.                                 {% elseif item.type == 'categorie' or item.type == 'sous-categorie' or item.type == 'Post' %}
  50.                                     {% set path_child_href = path('page',{slug:item.slug}) %}
  51.                                 {% elseif item.type == 'categorie-product' %}
  52.                                     {% set path_child_href = path('list_produit',{slug:item.slug}) %}
  53.                                 {% elseif item.type == 'list-faq' %}
  54.                                     {% set path_child_href = path('list_faq',{slug:item.slug}) %}
  55.                                 {% elseif item.type == 'plan-du-site'%}
  56.                                     {% set path_child_href = path('plan_du_site') %}
  57.                                 {% endif %} 
  58.                                 
  59.                                 {% if menu.child2 %}
  60.                                     <li><a title="{{item.title}}" href="{{path_child_href}}" {% if item.nofollow == true %}rel="nofollow"{% endif %} target="{{target[item.target]}}">{{item.title}}</a>
  61.                                     <ul>
  62.                                     {% for item2 in menu.child2 %}
  63.                                         {% if item2.parent == item.id %}
  64.                                             {% if item2.type == 'aucun' %}
  65.                                                 {% set path_child_href2 = '#' %}       
  66.                                             {% elseif item2.type == 'lien' %}
  67.                                                 {% set path_child_href2 = item2.url %}
  68.                                             {% elseif item2.type == 'categorie' or item2.type == 'sous-categorie' or item2.type == 'Post' %}
  69.                                                 {% set path_child_href2 = path('page',{slug:item2.slug}) %}
  70.                                             {% elseif item2.type == 'categorie-product' %}
  71.                                                 {% set path_child_href2 = path('list_produit',{slug:item2.slug}) %}
  72.                                             {% elseif item2.type == 'list-faq' %}
  73.                                                 {% set path_child_href2 = path('list_faq',{slug:item2.slug}) %}
  74.                                             {% elseif item2.type == 'plan-du-site'%}
  75.                                                 {% set path_child_href2 = path('plan_du_site') %}
  76.                                             {% endif %} 
  77.                                             <li><a title="{{item2.title}}" href="{{path_child_href2}}" {% if item2.nofollow == true %}rel="nofollow"{% endif %} target="{{target[item2.target]}}">{{item2.title}}</a></li>
  78.                                         {% endif %} 
  79.                                     {% endfor %}
  80.                                     </ul>
  81.                                 </li>
  82.                                 {% else %}
  83.                                     <li><a title="{{item.title}}" href="{{path_child_href}}" {% if item.nofollow == true %}rel="nofollow"{% endif %} target="{{target[item.target]}}">
  84.                                     {% if iconesNavigation %}
  85.                         
  86.                                         {% if menuDetails[key].icone is not empty %}
  87.                                             <img src="{{menuDetails[key].icone}}" alt="{{menu.title}}" class="icone" />
  88.                                         {% endif %}
  89.                                         {% if menuDetails[key].iconehover is not empty %}
  90.                                             <img src="{{menuDetails[key].iconehover}}" alt="{{menu.title}}" class="picto-hover" />
  91.                                         {% endif %}
  92.                                     {% endif %}
  93.                                     {{item.title}}</a></li>
  94.                                 {% endif %}
  95.                             {% endfor %}
  96.                             </ul>
  97.                         </li>
  98.                     {% else %}
  99.                     <li><a title="{{menu.title}}" href="{{path_href}}"  {% if menu.nofollow == true %}rel="nofollow"{% endif %} target="{{target[menu.target]}}">
  100.                         {% if iconesNavigation %}
  101.                             {% if menuDetails[key].icone is not empty %}
  102.                                 <img src="{{menuDetails[key].icone}}" alt="{{menu.title}}" class="icone" />
  103.                             {% endif %}
  104.                             {% if menuDetails[key].iconehover is not empty %}
  105.                                 <img src="{{menuDetails[key].iconehover}}" alt="{{menu.title}}" class="picto-hover" />
  106.                             {% endif %}
  107.                         {% endif %}
  108.                     {{menu.title}}</a></li>
  109.                 {% endif %} 
  110.         {% endfor %} 
  111.     
  112.         </ul>
  113.     </nav>
  114. {% endif %}