Multiple Menus
Multiple Menus
I'm new to CMSMS and I was wondering if it is possible to create multiple menus? I want to use the default left menu and I also want to add a horizontal menu to the header of my page. Is this possible?
Re: Multiple Menus
How does the tag differentiate between the different menus?
-
pishkus
Re: Multiple Menus
it doesn't.
Maybe you should try using different tpl files. You can find all the information you need in the 'Menu Manager' module (Extensions->Modules) 'Help' section.
Maybe you should try using different tpl files. You can find all the information you need in the 'Menu Manager' module (Extensions->Modules) 'Help' section.
Re: Multiple Menus
I read the help section and they give info on creating menus, but I didn't see anything on my specific problem.
Let me clarify...
I have two menus:
Menu 1 is in the left column of the page.
Menu 1
Menu 2
Let me clarify...
I have two menus:
Menu 1 is in the left column of the page.
Menu 1
- Menu 1 Link 1
- Menu 1 Link 2
- Menu 1 Link 3
Menu 2
- Menu 2 Link 1
- Menu 2 Link 2
- Menu 2 Link 3
Re: Multiple Menus
Yes this can be done with CMSMS. I was just looking how to do this with previous work and it was more simple than I ever thought.
Just put the menu tag in your layout where you want it. If you want one in header put it there and tell it what kind of template it should use. Also tell what is the start page. It might look something like this {cms_module module='menumanager' template='template_name' start_page="Menu 2" }
You might want to make "Menu 2" as content page or section header and other pages in that menu are parent of it. Then you set it not visible in Menu from it's page settings and also add {start_level='2'} inside that menu tag.
{cms_module module='menumanager' template='template_name' start_page="Menu 2" start_level='2' }
Then menu links start from second level and "Menu 2" itself is not visible anywhere.
Ofcourse you can combine different kind of navigation by selecting right template.
Maybe I'm missing something here but unfortunately I have all the files at work. Othervice very very simple when you done it once.
Have fun,
K
Just put the menu tag in your layout where you want it. If you want one in header put it there and tell it what kind of template it should use. Also tell what is the start page. It might look something like this {cms_module module='menumanager' template='template_name' start_page="Menu 2" }
You might want to make "Menu 2" as content page or section header and other pages in that menu are parent of it. Then you set it not visible in Menu from it's page settings and also add {start_level='2'} inside that menu tag.
{cms_module module='menumanager' template='template_name' start_page="Menu 2" start_level='2' }
Then menu links start from second level and "Menu 2" itself is not visible anywhere.
Ofcourse you can combine different kind of navigation by selecting right template.
Maybe I'm missing something here but unfortunately I have all the files at work. Othervice very very simple when you done it once.
Have fun,
K
Re: Multiple Menus
Works perfectly!!! Thanks!
Re: Multiple Menus
I have tried this solution - works fine, is easy to set up.
It does not validate, however, as you get incoorect nesting of the two ul´s.
Too bad.
It does not validate, however, as you get incoorect nesting of the two ul´s.
Too bad.
Re: Multiple Menus
I've noticed this too. But if you make copy from your menu template with different name and call that one then you have no problems with validation.
Br,
Keijo
Br,
Keijo
Re: Multiple Menus
I'm trying to achieve the same splitted navigation (First level on top of the layout, second level at the left side), but using the header link to child menu template. In this case, the first hierarchy consists of Section Headers that automatically link to their respective child.
The menu itself works a charm when you output it in one piece. But as soon as I split it and load the first bit of my navigation with number_of_levels="1", the Section Headers don't work properly anymore. Could it be that a Section Header isn't really considered a level, or would the chosen template need some adaptions to make it work for my case?
The menu itself works a charm when you output it in one piece. But as soon as I split it and load the first bit of my navigation with number_of_levels="1", the Section Headers don't work properly anymore. Could it be that a Section Header isn't really considered a level, or would the chosen template need some adaptions to make it work for my case?
Re: Multiple Menus
Never tried that template so no experience.
What you could also try is to make first level not as section header but a link to a second level page.
K
What you could also try is to make first level not as section header but a link to a second level page.
K
Re: Multiple Menus
Thanks for the input, KO! Since it urges with deadlines, I think I will do it the way you suggested (and explain the client that if he moves around submenu order, he should change the parentmenu link accordingly
) rather than spending too much time adapting the template.
-
Vin
Re: Multiple Menus
I've run into this problem as well, moonie, and little tweaked the header_to_link template. Here is my menu template for the top navigation:
You may have noticed that I use $node->titleattribute=='home' in template. This is just for the link to home/main page of the site to look like www.site.com, not like www.site.com/nav1link/nav2link, you can omit that condition if you want. Ensure you've inserted the menu tag like this:
and that it fits into your template (for instance, in the shared menu templates on the CMSMS site there are some with div class="menu", some without them).
Elijah Lofgren also wrote a solution for this kind of menu here (however, I have the feeling it wasn't available that time for me): http://wiki.cmsmadesimple.org/index.php/User_Handbook/Admin_Panel/Layout/Menu_Manager#header_link_to_child_dont_show_children
Code: Select all
{* CSS classes used in this template:
#active - The active/current page
.sectionheader - To style section header
hr.separator - To style the ruler for the separator *}
{if $count > 0}
<ul>
{foreach from=$nodelist item=node}
{if $doheaderlink == "1"}
{assign var="doheaderlink" value="0"}
<li class="sectionheader"><a href="{if $node->titleattribute == 'home'}/{else}{$node->url}{/if}">{$headertext}</a>
{/if}
{if $node->depth == 1}
{if $node->index > 0}
</li>
{/if}
{if $node->current == true}
<li id="active"><a href="{$node->url}"{if $node->target ne ""} target="{$node->target}"{/if}>{$node->menutext}</a>
{elseif $node->type == 'sectionheader'}
{assign var="doheaderlink" value="1"}
{assign var="headertext" value=$node->menutext}
{elseif $node->type == 'separator'}
<li id="separator">
{else}
<li><a href="{if $node->titleattribute=='home'}/{else}{$node->url}{/if}"{if $node->target ne ""} target="{$node->target}"{/if}>{$node->menutext}</a>
{/if}
{/if}
{/foreach}
</li>
</ul>
{/if}Code: Select all
{menu template="top_navigation" start_level="1" [b]number_of_levels="2"[/b]}Elijah Lofgren also wrote a solution for this kind of menu here (however, I have the feeling it wasn't available that time for me): http://wiki.cmsmadesimple.org/index.php/User_Handbook/Admin_Panel/Layout/Menu_Manager#header_link_to_child_dont_show_children
Last edited by Vin on Wed Mar 14, 2007 10:30 am, edited 1 time in total.

