Header Menu is not working

purva1002
Tera Contributor

Hello,

I was trying to customize my header menu in the portal. For which I cloned the header menu . Since the Angular-ng template was not cloned I even cloned that as advised in one of the post in the community. But after that also it is not working.

The same thing when I tried in my personal instance it is working fine.

please help me.

5 REPLIES 5

Andrew Wortham
Kilo Guru

Hello Purva,



can you please let us know what your end goal is here?   Why are you cloning to header widget?   Can you just use the portal menus to add the links that you need to the header?   Rather than changing the Theme's header away from the Stock header, it is much more common to change the "Main menu" on the portal record in the back end interface.



If you do need a custom widget for some reason, why?


What version are you on?   What is the error, or what is happening when you try to use your new widget?  



Best,


Andrew


Hello Andrew,



Thanks for replying. Please find the answers for all the queries raised below:



1. reason for customizing the header menu : We need to add the language picker in the header menu which will be depend on the logged in user location.



2. end goal : we need to customize the header menu as shown below:


find_real_file.png


3.   I tried to change the "Main menu" first but it didnt worked as that time also the same error which is coming now was coming. For error please refer point 6.


        So after going through multiple community post I thought to try once after cloning the same.



4. Version : I am using "Helsinki" version.



5. My approach till now:


            1. created language picker widget.


              2. customized "header" & "footer". Added "language picker" widget in "header".


              3.   then created customized theme and included customized "header" & "footer"


              4. Then created menu items under table (sp_instance_menu) and added the "header menu" widget.



6.Error : I am getting below error:



find_real_file.png



Let me know if there is any misunderstanding from my end.



thanks,


Purva


Hello Purva,



Have to dig a little bit deeper here.   What is logged to the console?   If you are using Chrome you can right click the web page, select the last option of the menu "Inspect" and then select the console tab.



This console should include the code that contains the error and point you in the right direction towards what needs fixing.



So if you remove your custom language widget does the header work?   Can we isolate that the error exists with the language picker widget?



Once you verify that the issue is with the language picker widget can you please post the code of the widget here?  


Does anything function on your custom widget?   Or does the error pop up from the beginning and freeze the page?



There are lots of resources online on the nullpointerexception error.   Double check your code and ensure that all your variables are declared properly. (using the console may help)


java - What is a NullPointerException, and how do I fix it? - Stack Overflow



Hope this helps start you on the debugging path.



Best,


Andrew


purva1002
Tera Contributor

Hello Andrew,



Got the error. Now it is working fine.



Thanks again for help.



thanks,


Purva