Hello,
First of all this post should have gone in the "
Modules/Add-Ons" (or "
Layout and Design (CSS & HTML)") forum, some moderator might move this.
Second there seem to be some redundant classes and spans in your menu.
The class="sub" for sub-lists is not needed, you could use ul#nav ul { } to style the sub-lists.
The same thing with the class="top_link" for each link in a listitem of class "top"...
li.top a { } would do the same as a.top_link { }
Also the doesn't seem to be needed.
Anyhow, a very simple menu template that would create such output:
Code: Select all
{if $count > 0}
<ul id="nav">
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{repeat string='<ul class="sub">' 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->depth <= 1}
<li class="top"><a href="{$node->url}" id="{$node->alias}" class="top_link"><span class="down">{$node->menutext}</span></a></li>
{else}
<li><a href="{$node->url}" id="{$node->alias}">{$node->menutext}</a></li>
{/if}
{/foreach}
{repeat string="</li></ul>" times=$node->depth-1}</li>
</ul>
{/if}
Try something like this (attach the "Accessibility and cross-browser tools" stylesheet to your page template to hide the accessibility navigation):
Code: Select all
{if $count > 0}
<ul id="nav">
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{repeat string='<ul class="sub">' 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="{if $node->depth <= 1}top {/if}currentpage"><h3><dfn>Current page is {$node->hierarchy}: </dfn>{$node->menutext}</h3>
{elseif $node->parent == true}
<li class="{if $node->depth <= 1}top {/if}activeparent"><a class="{if $node->depth <= 1}top_link {/if}activeparent" href="{$node->url}"{if $node->accesskey != ''} accesskey="{$node->accesskey}"{/if}{if $node->tabindex != ''} tabindex="{$node->tabindex}"{/if}{if $node->titleattribute != ''} title="{$node->titleattribute}"{/if}><dfn>{$node->hierarchy}: </dfn>{if $node->depth <= 1}<span class="down">{/if}{$node->menutext}{if $node->depth <= 1}</span>{/if}</a>
{elseif $node->type == 'sectionheader'}
<li class="{if $node->depth <= 1}top {/if}sectionheader">{$node->menutext}
{elseif $node->type == 'separator'}
<li class="{if $node->depth <= 1}top {/if}separator" style="list-style-type: none;"> <hr />
{else}
<li{if $node->depth <= 1} class="top"{/if}><a{if $node->depth <= 1} class="top_link"{/if} 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>{$node->hierarchy}: </dfn>{if $node->depth <= 1}<span class="down">{/if}{$node->menutext}{if $node->depth == 0}</span>{/if}</a>
{/if}
{/foreach}
{repeat string="</li></ul>" times=$node->depth-1}</li>
</ul>
{/if}
Regards,
D