show_children_of MenuManager

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.
Post Reply
giggler
Forum Members
Forum Members
Posts: 197
Joined: Tue Oct 09, 2007 7:08 am

show_children_of MenuManager

Post by giggler »

How do you change show_children_of to show only the first level and not any sub level?
cyberman

Re: show_children_of MenuManager

Post by cyberman »

There are a lot of parameters inside modules help :)!!!

Search for number_of_levels.
giggler
Forum Members
Forum Members
Posts: 197
Joined: Tue Oct 09, 2007 7:08 am

Re: show_children_of MenuManager

Post 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'}
cyberman

Re: show_children_of MenuManager

Post by cyberman »

Please post the template.
giggler
Forum Members
Forum Members
Posts: 197
Joined: Tue Oct 09, 2007 7:08 am

Re: show_children_of MenuManager

Post 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}
cyberman

Re: show_children_of MenuManager

Post 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 ...
giggler
Forum Members
Forum Members
Posts: 197
Joined: Tue Oct 09, 2007 7:08 am

Re: show_children_of MenuManager

Post by giggler »

I'm clueless on this one. I just got the code from here:

http://wiki.cmsmadesimple.org/index.php ... hildren_of
cyberman

Re: show_children_of MenuManager

Post 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}
giggler
Forum Members
Forum Members
Posts: 197
Joined: Tue Oct 09, 2007 7:08 am

Re: show_children_of MenuManager

Post 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?
cyberman

Re: show_children_of MenuManager

Post 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'.
giggler
Forum Members
Forum Members
Posts: 197
Joined: Tue Oct 09, 2007 7:08 am

Re: show_children_of MenuManager

Post 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!
Post Reply

Return to “CMSMS Core”