Page 1 of 1

Second menu to display children of current level only

Posted: Tue Jan 03, 2012 11:13 pm
by Flash01
I know i am missing something simple here.

the site is http://www.nstra.webeasykennels.com

I want the sub menu (top) to display the children (if any, if not be blank, except for deepest level) of the current page only. or to display the deepest level (3) if there.

I achieved it kinda by starting at level 3 when i added the menu smarty, but I miss the children of level 1 and 2.

I am using this for the subnav now:

Code: Select all

{if $count > 0}
<ul id="submenu" class="subsf-menu">
{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->parent == true or ($node->current == true and $node->haschildren == true)}
<li><a class="subcurrent" {elseif $node->current == true}
<li><a class="subcurrent" {elseif $node->haschildren == true}
<li><a {elseif $node->type == 'sectionheader'}
<li>{$node->menutext} {elseif $node->type == 'separator'}
<li> <br />{else}
<li><a {/if} {if $node->type != 'sectionheader' and $node->type != 'separator'}href="{$node->url}" {if $node->accesskey != ''}accesskey="{$node->accesskey}" {/if}{if $node->tabindex != ''}tabindex="{$node->tabindex}" {/if}{if $node->titleattribute != ''}title="{$node->titleattribute}"{else}title="{$node->menutext}"{/if}{if $node->target ne ""} target="{$node->target}"{/if}><dfn>{$node->hierarchy}: </dfn><span>{$node->menutext}</span></a>
{elseif $node->type == 'sectionheader'}><dfn>{$node->hierarchy}: </dfn><span>{$node->menutext}</span></a>{/if}{/foreach}{repeat string="</li></ul>" times=$node->depth-2}</li></ul>
{/if}
Sorry to be so dimwitted... any help would be greatly appreciated.
I am runnind cmsms v. 1.10.2
Thanks in advance.

Re: Second menu to display children of current level only

Posted: Wed Jan 04, 2012 3:01 am
by Dr.CSS
Let's start with what you have, a left side fly out menu showing 3 levels...

What do or don't you want to show and when, only the children of the active parent page or ?...

Re: Second menu to display children of current level only

Posted: Wed Jan 04, 2012 2:28 pm
by Flash01
The left hand nav will show everything... there eventually may be more than 3 levels, although i doubt it, lets assume for now that it will max at 3 lvls.

What i want to show in the horizontal sub nav is the children of the active page... except if you are on a lvl 3 page, then i want the other level 3 items to show up in the sub nav.

so children of the active page, unless it is the last level then all the pages in that level.

Hope that makes sense.

Re: Second menu to display children of current level only

Posted: Wed Jan 04, 2012 7:23 pm
by Dr.CSS
If the 3rd level isn't shown how are they going to get to it?...

Re: Second menu to display children of current level only

Posted: Wed Jan 04, 2012 7:38 pm
by Flash01
All items will appear and be accessible from the left hand menu.

The idea of the sub nav (top) is that it will only show the children of the current page, unless it is the last level (only used in the national trials section), then show the other pages in that level.