You need to sign in to do that
Don't have an account?
Sirisha K
How to hide a navigation menu item in the lightning community dynamically?
Hi There,
I have configured a navigation menu in the lightning community builder with few menu items and I want to hide one of these items dynamically for few users when they launch the community based on their access.
My community has a custom header component and each of the navigation menu item is a community page which in turn contain a custom lightning component.
My plan is to execute a js in the header lightning component controller in the init() function. I'm trying to fetch the id of the navigation menu item that i want to hide and add a css (display:none) dynamically.
But then, I'm not able get the reference of the menu-item component. I tried using document.getElementByClassName but I couldn't get the DOM of navigation menu in the header component in the header component.
Please let me know if anybody has any other thoughts around this and let me know if you need more details on my question.
Thanks for your time,
Sirisha
I have configured a navigation menu in the lightning community builder with few menu items and I want to hide one of these items dynamically for few users when they launch the community based on their access.
My community has a custom header component and each of the navigation menu item is a community page which in turn contain a custom lightning component.
My plan is to execute a js in the header lightning component controller in the init() function. I'm trying to fetch the id of the navigation menu item that i want to hide and add a css (display:none) dynamically.
But then, I'm not able get the reference of the menu-item component. I tried using document.getElementByClassName but I couldn't get the DOM of navigation menu in the header component in the header component.
Please let me know if anybody has any other thoughts around this and let me know if you need more details on my question.
Thanks for your time,
Sirisha
can you share your header component code onces / navigation menu item component code
thanks