A menu change

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
MeneM

A menu change

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

Re: A menu change

Post 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...
MeneM

Re: A menu change

Post by MeneM »

Ah yes, that did the trick very nicely!

Thank you very much for that!
Locked

Return to “CMSMS Core”