17th May '22
/
5 comments

How to Combine Multiple Menus into Bricks’ Mobile Menu

How to Combine Multiple Menus into Bricks’ Mobile Menu

Bricks' native 'Nav Menu' element comes with a built-in mobile menu, which shrinks the menu down to a menu toggle button to open an offcanvas type container.

In this Pro tutorial, we'll look at how we can combine multiple menus into this one mobile menu, so even though we may have multiple menus in different locations for desktop devices, for mobiles it'll reduce to just one menu toggle button and all the menu items will be found inside of one mobile menu.

Example header with multiple, separate menus.. here we have three menus

For mobile, we want them all to be contained within one mobile menu and have only one menu toggle button to reveal them.

mobile-menu

Choosing the Mobile Menu

The first step is to choose which of our menus is our 'main menu', which will be used for our one mobile menu. A sensible way to choose could be just based on where we want our menu toggle button to be placed. If we have multiple header rows, it'll be the menu that is positioned inside of the header row where we want our menu toggle to appear on mobile.

Then we note the element's ID for use later, it'll look something like 'brxe-jlvunl' (written in the class dropdown).

Lastly, we choose the width where the mobile menu needs to kick in, for eg choosing 'Mobile landscape' from the 'Show Mobile Menu Toggle' dropdown will ensure the mobile menu toggle is visible at 478px and below.

Choosing the 'Other Menus'

Not every menu on the page may need to be included in our mobile menu. For example, some menus inside of the footer may need their own menu toggle, or maybe have no separate mobile version at all.

The way to select which menus are included is to give them a class. Any menus where the menu items need to be included inside of our mobile menu, we'll give them a class 'move-menu'. We also need to set the width for where the mobile menu kicks in, to match our main menu. For example, select 'Mobile landscape' again. (important - this needs to be the same as the main menu to make sure the menu items are all hidden at the same width)

Combining into One Mobile Menu

This is a BricksLabs Pro tutorial.

For full access login below or create your BricksLabs Pro account

Get access to all 610 Bricks code tutorials with BricksLabs Pro

Related Tutorials..

How to Add a Dot Separator Between Nav Menu Items in Bricks

How to Add a Dot Separator Between Nav Menu Items in Bricks

Looking to add a circular dot separator between the nav menu items in your Bricks site? Add the following at Bricks → Settings → Custom…
Categories:
Tags:
Pro
New Ribbon for Posts in Bricks

New Ribbon for Posts in Bricks

This Pro tutorial provides the steps to display a "New" ribbon for posts that were published in the last x days in Bricks. Update: Added…
Categories:
Tags:
Width and Height of Mobile Hamburger Toggle in Bricks

Width and Height of Mobile Hamburger Toggle in Bricks

Looking to change the size of Bricks hamburger toggle in the mobile menu? The default width value of 20px can be changed by selecting the…
Categories:
How to Change the Hamburger Trigger Breakpoint in Bricks

How to Change the Hamburger Trigger Breakpoint in Bricks

Update: This option is built-into Bricks and following custom CSS is not needed. For the Nav Menu element, use the "Show Mobile Menu Toggle" dropdown.…
Categories:
Pro
Fixed Sidebar Layout in Bricks

Fixed Sidebar Layout in Bricks

A user asked: This Pro tutorial provides the steps to set up a fixed left (or can be on the right) sidebar using hooks and…
Categories:
Pro
Ken Burns Background Slideshow in Bricks

Ken Burns Background Slideshow in Bricks

Setting up a hero section, having images that pan and move as a background slideshow with content on top.
Categories:
Tags:
Pro
Oxygen’s Focus Section in Bricks

Oxygen’s Focus Section in Bricks

These are the steps to implement Focus Section, an Oxygen’s composite element, in Bricks.
Categories:
How to create filters with IsotopeJS in Bricks (Part 1)

How to create filters with IsotopeJS in Bricks (Part 1)

This tutorial series will explore the IsotopeJS library's features inside the Bricks ecosystem.
Categories:
Download Area with HappyFiles

Download Area with HappyFiles

Aside from the series I'm currently writing on how to create custom galleries and sliders with HappyFiles, Metabox and Bricks, I have developed a snippet…
Categories: