function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sirisha KSirisha 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
sfdcMonkey.comsfdcMonkey.com
hi Sirisha K 
can you share your header component code onces / navigation menu item component code 
thanks 
 
Goldy Raj 4Goldy Raj 4
how to hide navigation bar in community