Page 1 of 1

A menu change

Posted: Fri Sep 29, 2006 8:44 pm
by MeneM
Dear all,

Perhaps someone could be kind enough to help me here with a slight change in one of the default menu templates.

I would like to use this code for our menu:

Code: Select all

{* CSS classes used in this template:
.currentpage - The active/current page
.bullet_sectionheader - To style section header
hr.separator - To style the ruler for the separator *} 
{if $count > 0}
<ul class="clearfix">
{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->current == true}
<li><a href="{$node->url}" class="currentpage"{if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext} </a>



{elseif $node->type == 'sectionheader'}
<li class="sectionheader">{$node->menutext}

{elseif $node->type == 'separator'}
<li style="list-style-type: none;"> <hr class="separator" />

{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-1}</li>
</ul>
{/if}
But have it only show the top level link. The first level so to speak. Or "main page links"

I would think, although remarkably blessed with my amount of programming skills (aka: NADA), this is a simple change?

Thanks!
Mark

Re: A menu change

Posted: Fri Sep 29, 2006 9:38 pm
by Dr.CSS
If you look in Extensions » Modules on the right, across from the name of the module, is the word Help click that and you will get the parameters the module uses.... Note in newest Ver. CMSMS the name of the module works this way also...

You need  number_of_levels="1" in the tag for menu...

{cms_module module='menumanager' number_of_levels="1"}

new ver....

{menu number_of_levels="1"}

of course for both you may need to call the template... template='thenameofthetemplateyouwant'  defaults use .tpl, custom templates just the name of it no .tpl...

Re: A menu change

Posted: Thu Oct 05, 2006 6:23 am
by MeneM
Ah yes, that did the trick very nicely!

Thank you very much for that!