• Hi,

    Can I add multiple visibility classes for the menu.
    Eg: the menu should be visible on when the user belongs to group-1 and group-2.. other group users should not see this menu..

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,?
    Yes, you can use multiple classes. For your use-case,?try it like this:

    Create 2 menu elements of?the same name and add classes like:

    Menu Element:?add class – visible_to_group_1
    Menu Element: add class – visible_to_group_2 hidden_to_group_1

    Note: To use multiple visible_to_group classes like visible_to_group_123 visible_to_group_1234, then the user needs to be a member of both the groups to see the element.

    Regards,
    Team GrassBlade

    Thread Starter xenioodl

    (@xenioodl)

    Hi Saurabh,

    Thank you for replying. but when i had 2 classes the On UI it is shown as 1
    eg. I have 2 groups groupid 123 and groupid 456
    I add it to the menu item as visible_to_group_123 visible_to_group_456
    in Dev tool when i inspect it is shown as visible_to_group_123visible_to_group_456. it removes the space between the 2 classes.. I have noticed it happening after I save that menu. After saving that menu the spaces are removed. Please check the below link.
    In Image you will see that 2 visible classes are combined.. actually they are 3 different clases.
    https://paste.pics/AX5DE

    Thanks
    Xenio

    Hi,

    Make sure you’re not adding a comma (,) between both classes, like visible_to_group_123,visible_to_group_124. So if you’re using that please remove and use blank spaces.

    Note: To use multiple visible_to_group classes like visible_to_group_123 visible_to_group_1234, then the user needs to be a member of both the groups to see the element.

    Regards

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to add multiple classes’ is closed to new replies.