I have a simple site menu EXCEPT that I would like to either hide/show a menu item OR alternately enable it and set the path to a specific page depending on the Role of the member.
In CORVID I can take action on currentUser.role
import wixUsers from ‘wix-users’;
$w.onReady( function () {
const currentUser = wixUsers.currentUser;
if (currentUser.loggedIn) {
if (currentUser.role === ‘Member_Role’) {
//show or hide elements here:
// $w(“#horizontalMenu1”').MenuItem(6).show(); <=== yeah not.
// assumption here was I could create pages and show/hide
// the menu item linked based on the role
// Another thing that could work is enable/disable a menuitem
// and change the url/page link based on the role
}
}
But apparently “Horizontal Menus” have no MenuItems which have no visible properties (doh!)
So I suppose I am thinking about this the wrong way. I can find “MEGA MENU” examples but haven’t found “SIMPLE MENU” that I can manipulate the properties of example.
- So using WIX and Corvid what is the smart way to create a site menu.
Can someone point me in the right direction?
2. Answer to 1 may answer question 2 but, am I better off redirecting the link to the correct page than hiding showing 1 menu-item of several. I have about a dozen roles in this case and more will come along.
Thanks in advance
Robert