[SOLVED] Setting last class AND current item in Menu Manager
Posted: Sat Apr 12, 2008 1:07 pm
I've tried to set a "last class" in Menu Manager so i can remove some graphic on the last menu item and it's almost working perfectly. The only problem i have, is if the menu item is the current AND last it still shows the graphic. Isn't there some way to tell menu manager that something is both .last class and current?
My code:
I've tried to write this condition but something is wrong with it - looks like it won't accept the AND operator or i'm just plain wrong:
My code:
Code: Select all
{if $count > 0}
<ul>
{foreach from=$nodelist item=node name=items}
{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><a href="{$node->url}" {if $node->target ne ""}
target="{$node->target}"{/if}id="current" name="current">{$node->menutext}</a>
{elseif $node->parent == true}
<li><a href="{$node->url}" {if $node->target ne ""}
target="{$node->target}"{/if}id="currentAncestor" name="currentAncestor">{$node->menutext}</a>
{elseif $smarty.foreach.items.last}
<li class="last"><a href="{$node->url}" {if $node->target ne ""}
target="{$node->target}"{/if}>{$node->menutext}</a>
{elseif $node->type == 'sectionheader'}
<li class="sectionheader">{$node->menutext}
{elseif $node->type == 'separator'}
<li class="separator" style="list-style-type: none;"> <hr />
{else}
<li><a href="{$node->url}"{if $node->target ne ""} target="{$node->target}"{/if}>{$node->menutext}</a>{/if}
{/foreach}
{repeat string="</li></ul>" times=$node->depth-2}</li>
</ul>
{/if}
Code: Select all
{elseif $smarty.foreach.items.last and $node->current == true}
<li class="last"><a href="{$node->url}" {if $node->target ne ""}
target="{$node->target}"{/if}id="current" name="current">{$node->menutext}</a>