Page 1 of 1
show_children_of MenuManager
Posted: Thu Nov 29, 2007 9:00 am
by giggler
How do you change show_children_of to show only the first level and not any sub level?
Re: show_children_of MenuManager
Posted: Thu Nov 29, 2007 10:23 am
by cyberman
There are a lot of parameters inside modules help

!!!
Search for number_of_levels.
Re: show_children_of MenuManager
Posted: Thu Nov 29, 2007 2:59 pm
by giggler
Yeah, I tried that and when I use this it works, but shows the child of the start page:
Code: Select all
{cms_module module='menumanager' start_page='Parents' template='show_children_of'}
When I use this with the number of levels, it gives me a blank space, no menu at all.
Code: Select all
{cms_module module='menumanager' start_page='Parents' template='show_children_of' number_of_levels='1'}
Re: show_children_of MenuManager
Posted: Thu Nov 29, 2007 8:47 pm
by cyberman
Please post the template.
Re: show_children_of MenuManager
Posted: Fri Nov 30, 2007 8:43 am
by giggler
I just got this from the doc area. So maybe I just don't know what I need to change to get that to work.
Code: Select all
{if $count > 0}
{foreach from=$nodelist item=node}
{if $node->index == 0}
{assign var="icon" value="house"}
{elseif $node->haschildren == true }
{assign var="icon" value="folder"}
{elseif $node->haschildren == false }
{assign var="icon" value="page"}
{/if}
{if $node->index != 0}
<li><a href="{$node->url}"{if $node->target ne ""} target="{$node->target}"{/if}>{$node->menutext}</a></li>
{$node->titleattribute}
{/if}
{/foreach}
{/if}
Re: show_children_of MenuManager
Posted: Mon Dec 03, 2007 11:45 am
by cyberman
Are you sure template is complete?
In the first part I can see some assigns for var icon but it isn't used in the second part ...
Re: show_children_of MenuManager
Posted: Mon Dec 03, 2007 11:20 pm
by giggler
I'm clueless on this one. I just got the code from here:
http://wiki.cmsmadesimple.org/index.php ... hildren_of
Re: show_children_of MenuManager
Posted: Tue Dec 04, 2007 10:26 am
by cyberman
giggler wrote:
Code: Select all
<li><a href="{$node->url}"{if $node->target ne ""} target="{$node->target}"{/if}>{$node->menutext}</a></li>
{$node->titleattribute}
You should be sure to copy complete template - found this
url}"{if $node->target ne ""} target="{$node->target}"{/if}>{$node->menutext}
{$node->titleattribute}
Re: show_children_of MenuManager
Posted: Fri Dec 07, 2007 1:12 am
by giggler
I took that off since I don't need any icons. The menu shows, but it shows children of children as well and when using number of levels, the menu does not show at all. I would like to have only the first level of the menu shown. Any ideas?
Re: show_children_of MenuManager
Posted: Fri Dec 07, 2007 6:58 am
by cyberman
giggler wrote:
I would like to have only the first level of the menu shown. Any ideas?
Why you wont use MenuManagers template "simple_navigation' ?
That's IMHO all you need

...
Call it with parameter number_of_levels='1'.
Re: show_children_of MenuManager
Posted: Fri Dec 07, 2007 8:58 am
by giggler
I used that before and the shows the parent link as well:
parent
sub 1
sub 2
sub 3
Finally, I changed the level to 2 from 1 and it works the way I want it to now. I didn't think it counted the parent as a level, so I was using 1:
Code: Select all
{cms_module module='menumanager' start_page='Parents' template='show_children_of' number_of_levels='2'}
Thanks for your help - otherwise I would have given up and left it as is!