Page 1 of 1

How to show children without showing parent in menu?

Posted: Thu Oct 26, 2006 12:28 am
by wr3kt
I'm using 1.0.2.

I'm using the ellnav-vertical.

Example of my heirarchy:
2. Home
2.1 Something
2.2 Something Else
2.3 Something Further

I'm using this for the {menu}:
{menu template="home_menu" start_element="2"}

What I want the menu to look like:
Something
Something Else
Something Further

What I'm ending up with:
Home
Something
Something Else
Something Further

This is currently my pruned ellnav_vertical template:

Code: Select all

{if $count > 0}
<ul class="menu_horiz"id='home' onmouseover="Over('home')" onmouseout="Out('home')">
{foreach from=$nodelist item=node}
{if $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="current"><a class="current" href="{$node->url}"{if $node->target ne ""} target="{$node->target}"{/if}>{$node->menutext}</a>

{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>

What exactly am I missing to get rid of the parent part in the menu? I can't figure out the code to where if ($node == Home) continue. The java stuff is for popup menus that are part of the design.
Help?

Re: How to show children without showing parent in menu?

Posted: Thu Oct 26, 2006 5:27 am
by cyberman
wr3kt wrote: I'm using this for the {menu}:
{menu template="home_menu" start_element="2"}
Have you tried this?

Code: Select all

{menu template="home_menu" start_level="2"}

Re: How to show children without showing parent in menu?

Posted: Thu Oct 26, 2006 2:39 pm
by wr3kt
cyberman wrote:
wr3kt wrote: I'm using this for the {menu}:
{menu template="home_menu" start_element="2"}
Have you tried this?

Code: Select all

{menu template="home_menu" start_level="2"}
Doesn't list anything then.

Re: How to show children without showing parent in menu?

Posted: Thu Oct 26, 2006 9:46 pm
by Dr.CSS
Put the menu back the way it was and try the tag again... start_level="2"

Re: How to show children without showing parent in menu?

Posted: Sun Oct 29, 2006 9:59 pm
by wr3kt
mark wrote: Put the menu back the way it was and try the tag again... start_level="2"
Still shows nothing.

Re: How to show children without showing parent in menu?

Posted: Wed Nov 01, 2006 7:38 pm
by wr3kt
I guess there's no remedy :\

Re: How to show children without showing parent in menu?

Posted: Wed Nov 01, 2006 7:46 pm
by Kavrick
Here's a template that I use which does the trick.

Main2


{if $count > 0}
{foreach from=$nodelist item=node}
{if $node->index != 0}
url}"{if $node->target ne ""} target="{$node->target}"{/if}>{$node->menutext}
{$node->titleattribute}
{/if}
{/foreach}
{/if}


Then I just call it by using {menu template="main2" start_element="3" number_of_levels="2"} where start_element is the top level you don't want to show.

I'd look at the bulletmenu template too...

David

Re: How to show children without showing parent in menu?

Posted: Wed Nov 01, 2006 8:57 pm
by wr3kt
Beautiful!
Worked like a charm.