I have been trying to solve this problem for some hours now, but it takes me nowhere. I have something like the following as a navigation:
1. Content
1.1. Management
1.2. System
1.3. This
2. Open
2.1. Source
2.2. Solutions
3. Award
3.1. Winning
3.1.1. Software
What I need to do is to assign a class-attribute to each element, that follows the parent-element, as long as the parent-element is the root-element. Which is in the above example true for "1.1. Management", "2.1. Source" and "3.1. Winning". Any ideas how to do this with MenuManager? Below is the code I am using right now:
Code: Select all
{if $count > 0}
<ul class="menu-one">
{foreach from=$nodelist item=node name=alist}
{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{if ($node->current == true) && ($node->parent == false)} class="{if $smarty.foreach.alist.first}first {/if}{if $smarty.foreach.alist.last}last {/if}open"{/if}><h3><dfn>Aktive Seite ist {$node->hierarchy}: </dfn>{$node->menutext}</h3>
{else}
<li{if $node->parent == true} class="{if $smarty.foreach.alist.first}first {/if}{if $smarty.foreach.alist.last}last {/if}open"{else}{if $smarty.foreach.alist.first} class="first"{/if}{if $smarty.foreach.alist.last} class="last"{/if}{/if}><a href="{$node->url}"{if $node->accesskey != ''} accesskey="{$node->accesskey}"{/if}{if $node->tabindex != ''} tabindex="{$node->tabindex}"{/if}{if $node->titleattribute != ''} title="{$node->titleattribute}"{/if}{if $node->target != ''} target="{$node->target}"{/if}><dfn>{if $node->parent == true}Aktiver Bereich ist {/if}{$node->hierarchy}: </dfn>{$node->menutext}</a>
{/if}
{/foreach}
{repeat string="</li></ul>" times=$node->depth-1}</li>
</ul>
{/if}
Regards
Nils



