Skip to main content

Hi there,

I have two questions about top navigation menu. I would appreciate any assistance or help.

  1. The top navigation menu is located at Header → Custom HTML. How to apply generation of the link in the top navigation based on custom role? Like IF ID=1 OR ID=3 OR ID=8 THEN URL #1 ELSEIF ID=4 THEN URL #2 ELSE URL #3. How it is possible to achieve that logic in Custom HML in Header?
     
  2. User can open home page or other page in core navigation. How it is possible to achieve that if user visits the other page in core navigation the naming of this section in top nav change color to visually show where the user is located?

Thanks!

Hi sivanov,

thanks for sharing your question here. I have slightly adjusted the title so that others can find it more easily.

Unfortunately, I cannot answer your question, but maybe @tom.shaddock knows wich objects could help you to customize this?


Hi @sivanov so there’s presently no control to load different headers based on the roles of the user visiting the community. However it is in theory possible with some third party script magic!

Basically if you familiarise yourself with the inSidedData object (https://community.insided.com/third-party-scripts-117/how-to-create-dynamic-community-content-using-the-insideddata-object-1723) you’re able to obtain the user roles by running:

inSidedData.user.role

in your browser console, you’ll see that you get a comma delimited list of the roles the user has. You could then use some Javascript logic in your header code start to dynamically change the header elements depending on this role or roles. You could also use the inSided data object for your second point too, maybe a value in ‘inSidedData.page’ or ‘inSidedData.content’ might help you achieve this?

Hope this makes sense, please let me know if you have further questions! :relaxed:


Reply