{% set path_href = '/' %}
<label for="menu-handler"><span></span><span></span><span></span></label>
{% if menu_right %}
<nav class="primary-nav">
<ul>
{% for key,menu in menu_right %}
{% if menu.type == 'aucun' %}
{% set path_href = '#' %}
{% elseif menu.type == 'lien' %}
{% set path_href = menu.url %}
{% elseif menu.type == 'categorie' or menu.type == 'sous-categorie' or menu.type == 'Post' %}
{% set path_href = path('page',{slug:menu.slug}) %}
{% elseif menu.type == 'categorie-product' %}
{% set path_href = path('list_produit',{slug:menu.slug}) %}
{% elseif menu.type == 'list-faq' %}
{% set path_href = path('list_faq',{slug:menu.slug}) %}
{% elseif menu.type == 'plan-du-site'%}
{% set path_href = path('plan_du_site') %}
{% elseif menu.type == 'hub-activite' %}
{% set path_href = path('page_activites') %}
{% elseif menu.type == 'hub-localite' %}
{% set path_href = path('page_localite') %}
{% elseif menu.type == 'hub-actualite' %}
{% set path_href = path('page_nos_actualites') %}
{% elseif menu.type == 'activite_principal' %}
{% set path_href = path('page',{slug:menu.slug}) %}
{% elseif menu.type == 'secteur' %}
{% set path_href = path('page_details_localite',{slug:menu.slug}) %}
{% endif %}
{% if menu.child %}
<li><a title="{{menu.title}}" href="{{path_href}}" {% if menu.nofollow == true %}rel="nofollow"{% endif %} target="{{target[menu.target]}}">
{% if iconesNavigation %}
{% if menuDetails[key].icone is not empty %}
<img src="{{menuDetails[key].icone}}" alt="{{menu.title}}" class="icone" />
{% endif %}
{% if menuDetails[key].iconehover is not empty %}
<img src="{{menuDetails[key].iconehover}}" alt="{{menu.title}}" class="picto-hover" />
{% endif %}
{% endif %}
{{menu.title}}</a>
<ul>
{% for item in menu.child %}
{% if item.type == 'aucun' %}
{% set path_child_href = '#' %}
{% elseif item.type == 'lien' %}
{% set path_child_href = item.url %}
{% elseif item.type == 'categorie' or item.type == 'sous-categorie' or item.type == 'Post' %}
{% set path_child_href = path('page',{slug:item.slug}) %}
{% elseif item.type == 'categorie-product' %}
{% set path_child_href = path('list_produit',{slug:item.slug}) %}
{% elseif item.type == 'list-faq' %}
{% set path_child_href = path('list_faq',{slug:item.slug}) %}
{% elseif item.type == 'plan-du-site'%}
{% set path_child_href = path('plan_du_site') %}
{% endif %}
{% if menu.child2 %}
<li><a title="{{item.title}}" href="{{path_child_href}}" {% if item.nofollow == true %}rel="nofollow"{% endif %} target="{{target[item.target]}}">{{item.title}}</a>
<ul>
{% for item2 in menu.child2 %}
{% if item2.parent == item.id %}
{% if item2.type == 'aucun' %}
{% set path_child_href2 = '#' %}
{% elseif item2.type == 'lien' %}
{% set path_child_href2 = item2.url %}
{% elseif item2.type == 'categorie' or item2.type == 'sous-categorie' or item2.type == 'Post' %}
{% set path_child_href2 = path('page',{slug:item2.slug}) %}
{% elseif item2.type == 'categorie-product' %}
{% set path_child_href2 = path('list_produit',{slug:item2.slug}) %}
{% elseif item2.type == 'list-faq' %}
{% set path_child_href2 = path('list_faq',{slug:item2.slug}) %}
{% elseif item2.type == 'plan-du-site'%}
{% set path_child_href2 = path('plan_du_site') %}
{% endif %}
<li><a title="{{item2.title}}" href="{{path_child_href2}}" {% if item2.nofollow == true %}rel="nofollow"{% endif %} target="{{target[item2.target]}}">{{item2.title}}</a></li>
{% endif %}
{% endfor %}
</ul>
</li>
{% else %}
<li><a title="{{item.title}}" href="{{path_child_href}}" {% if item.nofollow == true %}rel="nofollow"{% endif %} target="{{target[item.target]}}">
{% if iconesNavigation %}
{% if menuDetails[key].icone is not empty %}
<img src="{{menuDetails[key].icone}}" alt="{{menu.title}}" class="icone" />
{% endif %}
{% if menuDetails[key].iconehover is not empty %}
<img src="{{menuDetails[key].iconehover}}" alt="{{menu.title}}" class="picto-hover" />
{% endif %}
{% endif %}
{{item.title}}</a></li>
{% endif %}
{% endfor %}
</ul>
</li>
{% else %}
<li><a title="{{menu.title}}" href="{{path_href}}" {% if menu.nofollow == true %}rel="nofollow"{% endif %} target="{{target[menu.target]}}">
{% if iconesNavigation %}
{% if menuDetails[key].icone is not empty %}
<img src="{{menuDetails[key].icone}}" alt="{{menu.title}}" class="icone" />
{% endif %}
{% if menuDetails[key].iconehover is not empty %}
<img src="{{menuDetails[key].iconehover}}" alt="{{menu.title}}" class="picto-hover" />
{% endif %}
{% endif %}
{{menu.title}}</a></li>
{% endif %}
{% endfor %}
</ul>
</nav>
{% endif %}