How to show children without showing parent in menu?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
wr3kt

How to show children without showing parent in menu?

Post 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?
Last edited by wr3kt on Thu Oct 26, 2006 12:30 am, edited 1 time in total.
cyberman

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

Post 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"}
wr3kt

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

Post 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.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

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

Post by Dr.CSS »

Put the menu back the way it was and try the tag again... start_level="2"
wr3kt

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

Post by wr3kt »

mark wrote: Put the menu back the way it was and try the tag again... start_level="2"
Still shows nothing.
wr3kt

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

Post by wr3kt »

I guess there's no remedy :\
Kavrick

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

Post 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
wr3kt

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

Post by wr3kt »

Beautiful!
Worked like a charm.
Locked

Return to “CMSMS Core”