How to customize mobile menus in masterPage.js?

Question:
Can I customize mobile app menus the same way I customize website menus using code in masterPage.js? If so, how?

Product:
velo API

What are you trying to achieve:
We are already customizing our website menus. We want to make the same changes appear on the mobile version of the website.

What have you already tried:

This code, running in masterPage.js, $w(‘#MobileMenu1’).menuItems always returns undefined

import wixWindow from 'wix-window';

$w.onReady(function () {

    if (wixWindow.formFactor === "Mobile") {
        console.log ($w('#mobileMenu1').menuItems);
    } else {
        changeMenu('#horizontalMenu1');
    }
});

Additional information:
If you go to uuse.org, the 2nd menu over, the Happenings menu, has two items with customized labels showing the dates of the latest eBlast and newsletter. This does not work on the mobile version of the site.

This might help - https://dev.wix.com/docs/velo/api-reference/$w/mobile-text/text

Ohh, do we just got some new APIs ?

2024-08-03 16_43_14-Window

1 Like

Sadly, there is no text property associated with a mobileMenu.

I upgraded to the newer mobile menus and it started working.

1 Like