Page 1 of 1

Two different menus

Posted: Fri Apr 30, 2021 2:02 pm
by Barrowboy
I am using version 2.2.15 and would like to have a second menu with different items.
So when selecting a page the menu changes.
For example Home page = menu 1 list of items
Other page menu 2 with different items.
At the moment I am using horizontal menu.

Can anyone tell me how or point me to an example.

Thanks

Re: Two different menus

Posted: Fri Apr 30, 2021 3:02 pm
by DIGI3
If you're using the same template for both pages then you'd probably want to use conditional statements, e.g.

Code: Select all

{if $page_alias=='home'}
  {Navigator items='foo,bar'}
{else}
  {Navigator items='one,two,banana,tuesday'}
{/if}
If you're using different page templates then just use different Navigator calls. If you're using template inheritance (ideal method) then make sure your {Navigator} call is in a {section} and change it in the child template accordingly.

You should also familiarize yourself with the Navigator parameters (see https://docs.cmsmadesimple.org/layout/d ... /navigator) as you might be able to achieve this without specifying the individual items, depending upon your page structure. childrenof, start_page, etc all accept variables.

Re: Two different menus

Posted: Fri Apr 30, 2021 3:33 pm
by Barrowboy
Hi
Is the navigator module a download if so were is it?

I am using two different templates two versions of Bandb so at the moment I am using bandb_topnav template in one and new_bandb_topnav in the other are these replaced by the navigation module.

Or can I just use {Navigation}

Thanks again for your help

Re: Two different menus

Posted: Fri Apr 30, 2021 3:47 pm
by DIGI3
Navigator is core so is included. You're already using it.

The templates aren't replaced by the Navigator module, they're FOR the Navigator module. Navigator provides the data, the template provides the layout.

Re: Two different menus

Posted: Sat May 01, 2021 9:21 am
by Barrowboy
After a lot of trial and error I now have it working.

Just one more question on the subject, regarding the sub menu items or child they go to the left can this be changed to go to the right.

What controls this?

Thanks

Re: Two different menus

Posted: Sat May 01, 2021 2:56 pm
by DIGI3
I'm assuming you mean the dropdown submenu flyout direction. You might be able to change it with the data-alignment parameter (see https://get.foundation/sites/docs/dropdown-menu.html) but it may also require some css overrides. That's an operation of the framework you're using and well outside the scope of a CMSMS forum though.

Re: Two different menus

Posted: Thu May 06, 2021 9:40 am
by Barrowboy
All sorted.

Thanks.