[SOLVED] Menu Modification

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
falkencreative
Forum Members
Forum Members
Posts: 11
Joined: Wed Oct 01, 2008 3:14 am

[SOLVED] Menu Modification

Post by falkencreative »

Hello all.  I've been working in the web design field for a couple years, but finally decided to take the plunge and start working with a CMS.  Quick question in regards to modifying the functionality of the navigation menu...

The current site I am working with is here: http://www.ethsc hoirs.co m/dev/ (remove the spaces).  This shows the issue I have been having.

Currently, the menu shows all menu items and all subitems.  By default, I would prefer to hide the subitems, only showing them when the user is visiting the correct category.  For example, the subitems under "Soundsation and Choralistics" should not display unless the visitor is on the main "Soundsation and Choralistics" page (or on any of those subpages, of course).

Hopefully this makes sense -- let me know if you need more clarification.  I have searched the support documents, and I'm not seeing anything specifically related to this.  Could someone point me in the right direction, either with examples or a link to something that might help?  Thanks!
Last edited by falkencreative on Wed Oct 01, 2008 7:31 am, edited 1 time in total.
User avatar
Augustas
Forum Members
Forum Members
Posts: 241
Joined: Wed Oct 17, 2007 6:09 pm

Re: Menu Modification

Post by Augustas »

Hello,

could you post here the place in your template where you call this {menu}

Basicly you need to study parameters available for {menu} tag. You can access it in your CMS admin:
/listmodules.php?action=showmodulehelp&module=MenuManager
see where it says "Parameters"
http://FollowTheRoad.com/ - living on the road...
http://www.kligys.com/ - asmeninis blog'as...
falkencreative
Forum Members
Forum Members
Posts: 11
Joined: Wed Oct 01, 2008 3:14 am

Re: Menu Modification

Post by falkencreative »

Augustas wrote: could you post here the place in your template where you call this {menu}
Here is how I call the menu:

Code: Select all

{menu template='ETHS Vocal Music Menu'}
And here is the template file I am using:

Code: Select all

{if $count > 0}
<ul>
{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 class="currentpage">{$node->menutext}

{elseif $node->parent == true}
<li class="activeparent"><a class="activeparent" href="{$node->url}"{if $node->accesskey != ''} accesskey="{$node->accesskey}"{/if}{if $node->tabindex != ''} tabindex="{$node->tabindex}"{/if}{if $node->titleattribute != ''} title="{$node->titleattribute}"{/if}>{$node->menutext}</a>

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

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

{else}
<li><a href="{$node->url}"{if $node->accesskey != ''} accesskey="{$node->accesskey}"{/if}{if $node->tabindex != ''} tabindex="{$node->tabindex}"{/if}{if $node->titleattribute != ''} title="{$node->titleattribute}"{/if}{if $node->target != ''} target="{$node->target}"{/if}>{$node->menutext}</a>

{/if}

{/foreach}
{repeat string="</li></ul>" times=$node->depth-1}</li>
</ul>
{/if}
Last edited by falkencreative on Wed Oct 01, 2008 7:17 am, edited 1 time in total.
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: Menu Modification

Post by RonnyK »

What about adding
collapse='1'
to your {menu}-call

Ronny
falkencreative
Forum Members
Forum Members
Posts: 11
Joined: Wed Oct 01, 2008 3:14 am

[SOLVED] Re: Menu Modification

Post by falkencreative »

RonnyK wrote: What about adding
collapse='1'
to your {menu}-call

Ronny
I just found that in the help, and added it... it works... almost.  If you visit the test site (http://www.ethsc oirs.com/dev/ -- remove the spaces) you will see that it does collapse menu items.  However, if I click on a category that has several subitems ("Soundsation and Choralistics" for example) all of the subitems for all categories appear, not just the subitems for that specific category.  Is there a way around that?

EDIT: Nevermind, I figured it out.  I had multiple page templates (Home page/content page/etc) and I missed saving my content page's template with the revised menu code.  It's working fine now.  Thanks Ronny / Augustas for pointing me in the right direction.
Last edited by falkencreative on Wed Oct 01, 2008 7:30 am, edited 1 time in total.
Post Reply

Return to “CMSMS Core”