20/09/2011, 23:28:04
merci jean, c'est éxactement ce que je cherchais, par contre j'ai un souci, dans mon template je retrouve bien les deux première lignes de ton code mais ensuite il me semble que les templates ont été modifié avec les nouvelles versions du cms du coup je nage un peu dans le php, j'ai mis comme suit, mais cela ne fonctionne pas évidement.. tu aurais des pistes pou moi.
merci d'avance !
merci d'avance !
Code :
{* CSS classes used in this template:
#menuwrapper - The id for the <div> that the menu is wrapped in. Sets the width, background etc. for the menu.
#primary-nav - The id for the <ul>
.menuparent - The class for each <li> that has children.
.menuactive - The class for each <li> that is active or is a parent (on any level) of a child that is active. *}
{assign var='number_of_levels' value=10000}
{if isset($menuparams.number_of_levels)}
{assign var='number_of_levels' value=$menuparams.number_of_levels}
{/if}
{if $count > 0}
<div id="menuwrapper">
<ul id="primary-nav">
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{repeat string='<ul class="unli">' times=$node->depth-$node->prevdepth}
{elseif $node->depth < $node->prevdepth}
{repeat string='</li><li class="separator once" style="list-style-type: none;"> </li></ul>' times=$node->prevdepth-$node->depth}
</li>
{elseif $node->index > 0}</li>
{/if}
{if $node->depth==1 and $node->haschildren == false}<li class="menu{$node->hierarchy}"><a
{elseif $node->parent == true or ($node->current == true and $node->haschildren == true)}
{assign var='classes' value='menuactive'}
<li class="menuactive menuparent menu{$node->hierarchy}">
<a class="menuactive menuparent" {elseif $node->current == true}
<li class="menuactive">
<a class="menuactive" {elseif $node->haschildren == true}
{if $node->parent == true}
{assign var='classes' value='menuactive menuparent'}
<li class="menuparent menu{$node->hierarchy}">
<a class="menuparent" {elseif $node->type == 'sectionheader' and $node->haschildren == true}
<li class="sectionheader"><span class="sectionheader">{$node->menutext}</span> {elseif $node->type == 'separator'}
<li style="list-style-type: none;"> <hr class="menu_separator" />
{else}
<li>
<a
{/if}
{if $node->children_exist == true and $node->depth < $number_of_levels}
{assign var='classes' value=$classes|cat:' parent'}
{/if}
{if $node->type == 'sectionheader'}
<li class="{$classes}"><a class="{$classes}"><span class="sectionheader">{$node->menutext}</span></a>
{else}
<li class="{$classes}"><a class="{$classes}"
{/if}
{elseif $node->type == 'sectionheader' and $node->haschildren == true}
<li><a ><span class="sectionheader">{$node->menutext}</span></a>
{elseif $node->type == 'sectionheader'}
<li><a ><span class="sectionheader">{$node->menutext}</span></a>
{elseif $node->type == 'separator'}
<li style="list-style-type: none;"> <hr class="menu_separator" />
{elseif $node->children_exist == true and $node->depth < $number_of_levels and $node->type != 'sectionheader' and $node->type != 'separator'}
<li class="menuparent"><a class="menuparent"
{else}
<li>
<a
{/if}
{if $node->type != 'sectionheader' and $node->type != 'separator'}
{if $node->target}target="{$node->target}" {/if}
href="{$node->url}"><span>{$node->menutext}</span></a>
{/if}
{/foreach}
{repeat string='</li><li class="separator once" style="list-style-type: none;"> </li></ul>' times=$node->depth-1}
</li>
</ul>
<div class="clearb"></div>
</div>
{/if}