Two different menus

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
Barrowboy
Forum Members
Forum Members
Posts: 223
Joined: Mon Dec 16, 2013 4:09 pm

Two different menus

Post 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
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1609
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: Two different menus

Post 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.
Not getting the answer you need? CMSMS support options
Barrowboy
Forum Members
Forum Members
Posts: 223
Joined: Mon Dec 16, 2013 4:09 pm

Re: Two different menus

Post 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
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1609
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: Two different menus

Post 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.
Not getting the answer you need? CMSMS support options
Barrowboy
Forum Members
Forum Members
Posts: 223
Joined: Mon Dec 16, 2013 4:09 pm

Re: Two different menus

Post 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
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1609
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: Two different menus

Post 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.
Not getting the answer you need? CMSMS support options
Barrowboy
Forum Members
Forum Members
Posts: 223
Joined: Mon Dec 16, 2013 4:09 pm

Re: Two different menus

Post by Barrowboy »

All sorted.

Thanks.
Post Reply

Return to “Layout and Design (CSS & HTML)”