03/06/2010, 02:49:40
Alors voici comment j'ai ajouté les class dans le fichier minimal_menu.tpl. Les <li> sont identifiés de <li class="li1"> à <li class="li5">.
Voici le code source généré pour le menu :
Est-ce que vous y remarqué quelque chose d'anormal?
Code :
{* CSS classes used in this template:
.currentpage - The active/current page
.bullet_sectionheader - To style section header
hr.separator - To style the ruler for the separator *}
{if $count > 0}
<ul class="clearfix">
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{repeat string="<ul>" times=$node->depth-$node->prevdepth}
{elseif $node->depth < $node->prevdepth}
{repeat string="</li></ul>" times=$node->prevdepth-$node->depth}
</li>
{elseif $node->index > 0}</li>
{/if}
{if $node->current == true}
<li class="li1"><a href="{$node->url}" class="currentpage"{if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext} </a>
{elseif $node->parent == true && $node->depth == 1 and $node->type != 'sectionheader' and $node->type != 'separator'}
<li class="activeparent li2"> <a href="{$node->url}" class="activeparent"{if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext} </a>
{elseif $node->type == 'sectionheader'}
<li class="sectionheader li3">{$node->menutext}
{elseif $node->type == 'separator'}
<li style="list-style-type: none;" class="li4"> <hr class="separator" />
{else}
<li class="li5"><a href="{$node->url}"{if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext} </a>
{/if}
{/foreach}
{repeat string="</li></ul>" times=$node->depth-1}</li>
</ul>
{/if}
Code :
<ul class="clearfix">
<ul>
<li class="li1"><a href="http://24x15degres.com/cms/" class="currentpage"> Accueil </a></li>
<li class="li5"><a href="http://24x15degres.com/cms/index.php?page=projets"> Projets </a></li>
<li class="li5"><a href="http://24x15degres.com/cms/index.php?page=informationpourlacheteur"> Information pour l'acheteur </a></li>
<li class="li5"><a href="http://24x15degres.com/cms/index.php?page=a-propos-de-nous"> À propos de nous </a></li>
<li class="li5"><a href="http://24x15degres.com/cms/index.php?page=publications"> Information & Publications </a></li>
<li class="li5"><a href="http://24x15degres.com/cms/index.php?page=partenaires"> Partenaires </a></li>
<li class="li5"><a href="http://24x15degres.com/cms/index.php?page=contactez-nous"> Contactez-nous </a></li>
</ul></li>
</ul>