The Now Platform® Washington DC release is live. Watch now!

Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Cloning the Header Menu Widget

bbarber9
Mega Expert

Has anyone successfully cloned the header menu widget in the new service portal? I cloned it, but when I put it in a page, things seem to get really glitchy.

EDIT: Figured this out. Turns out cloning the header menu widget is probably a bad idea. If you want to customize the navbar etc, you are probably better off cloning the stock header under Headers & Footers and then including it in a custom theme.

14 REPLIES 14

mandle
Mega Guru

Breyton,



There's a bug in the "Clone" widget functionality at present. If a widget has related "Angular ng-templates" they ARE NOT cloned as well.


I believe the "Header Menu" widget has 2 "Angular ng-templates".



Once you clone the "Header Menu" widget just go here: https://YOURINSTANCE.service-now.com/sp_ng_template_list.do?sysparm_query=sp_widget%3D5ef595c1cb1202...



and then for each of the 2 "Angular ng-templates" just do an "Insert & Stay" after changing the "ID" to the id of your newly cloned "Header Menu" widget.


That is really helpful. I noticed that they weren't getting cloned, but I wasn't sure how to point the clone to them. Thanks for the response!


Jeremy,



I just tried to do the insert and stay on one of the templates and it gave me a duplicate entry error. I changed the widget reference to my cloned widget and left the ID field(the name) the same. It seems that it uses the ID field as a key. Any workarounds there?


Jeremy,



Sort of... you can certainly clone the widget and bring in the ng-templates however the "spDropdownTreeTemplate" template is actually called from a directive called on the file system and since you cannot have two templates with the same name you would also have to clone the directive and recreate that as well. The spDropdownTreeTemplate is responsible for the scripted dropdown menus so if you're not using those you should be fine.



I do think this is a bug though... a widget should not call a directive that lives on the file system which then calls a template on the file system. That's just weird and prevents developers from cloning or updating the widget.