Page 1 of 1
more than one menu?
Posted: Fri Aug 13, 2010 11:02 am
by toolman
Hi there,
Is it possible to have more than one menu, e.g a top menu and then another menu underneath it that I can apply pages to?
thanks
Re: more than one menu?
Posted: Fri Aug 13, 2010 12:03 pm
by uniqu3
Yes it is possible, it depends how you want to use the second menu, the best is you read help section of the MenuManager.
Some options:
{menu start_level='2'} this would show sublevels in the second menu
{menu includeprefix='alias1,alias2,alis3} would only show alias 1,2,3
{menu excludeprefix='alias1,alias2'} would hide alias1,2 and so on.
Re: more than one menu?
Posted: Fri Aug 13, 2010 4:51 pm
by toolman
Thanks for the reply. Is it possible to set up a menu so that I can apply pages to it in admin, rather than having to modify the code each time I add a page?
Re: more than one menu?
Posted: Fri Aug 13, 2010 4:56 pm
by Dr.CSS
There is also a child of parameter, this will let you set a section header as not shown in menu then use this to show children of...
(optional) childrenof="" - This option will have the menu only display items that are descendants of the selected page id or alias. i.e: {menu childrenof=$page_alias} will only display the children of the current page.
Re: more than one menu?
Posted: Fri Aug 13, 2010 5:57 pm
by toolman
Thanks. I have tried this, but nothing is showing:
{menu childrenof=$services}
Re: more than one menu?
Posted: Fri Aug 13, 2010 6:24 pm
by Dr.CSS
When it says $page_alias that means it will get the page alias of the page it's on and show the children of it, if you want to show from the page alias "services" just use services w/o $...
Re: more than one menu?
Posted: Fri Aug 13, 2010 6:47 pm
by toolman
Thanks. I have it working, but I am trying to include a menu in a div that is a drop down.
However, the code I am using is replacing/renaming the main menu item.
This is my code:
[php]
alias}">
{if $node->alias == 'services'}
{menu childrenof=services-menu}
............
[/php]
Can anyone see a reason why this is not working?
Re: more than one menu?
Posted: Fri Aug 13, 2010 11:31 pm
by Dr.CSS
Is this going to be just menu items that are children of services or children of whatever page you are on?...
Re: more than one menu?
Posted: Sat Aug 14, 2010 9:25 am
by owr_bgld
toolman wrote:
.......
{if $node->alias == 'services'}
.......
{menu childrenof=services-menu}
.......
do you see the difference?
should work - and don't forget the ""
Re: more than one menu?
Posted: Sat Aug 14, 2010 4:05 pm
by maranc
Re: more than one menu?
Posted: Fri Sep 17, 2010 4:55 pm
by micahgodbolt
{menu childrenof=$page_alias} is perfect! I was wondering how I could do this. I had in my mind an hour's worth of work creating a new menu in menu manager that started at 2nd level only.....THis is much easier.