Page 1 of 1
[SOLVED] Menu Modification
Posted: Wed Oct 01, 2008 3:26 am
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!
Re: Menu Modification
Posted: Wed Oct 01, 2008 3:32 am
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"
Re: Menu Modification
Posted: Wed Oct 01, 2008 7:05 am
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}
Re: Menu Modification
Posted: Wed Oct 01, 2008 7:19 am
by RonnyK
What about adding
collapse='1'
to your {menu}-call
Ronny
[SOLVED] Re: Menu Modification
Posted: Wed Oct 01, 2008 7:23 am
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.