How do you set a menu to open links in new window in the Service Portal?

jasonward
Kilo Contributor

I know that there's not an option for setting a Menu Item to open in a new window, so I'm exploring options for opening any external URLs in a new window. This is primarily around the Header Menu, though it would be applicable to any Menu widget that's used in the Service Portal. Is there something easy that I'm missing?

Thanks!

1 ACCEPTED SOLUTION

Rushit Patel2
Tera Guru

Hi Jason,



there is not OOB way i could find.


follow below steps.


1)on menu item form create a new field(type true/false). like shown in below image.


find_real_file.png


check the new window(custom field) checkbox for links that u want to open in new window.



2) go to Angular ng-template(sp_ng_template.list) table. open record with id "menuTemplate".



replace first line with below two lines.


<a ng-if="item.items.length == 0 && !item.scriptedItems && !item.u_new_window" ng-href="{{item.href}}">{{ item.label }}</a>


<a ng-if="item.items.length == 0 && !item.scriptedItems && item.u_new_window" ng-href="{{item.href}}" target="_blank">{{ item.label }}</a>



like shown in below image.


find_real_file.png



let me know if any issues.



(please mark helpful/correct/like based on impact)


View solution in original post

5 REPLIES 5

URL Target = _blank worked for me. The original fix above worked but it caused all of the menu items to be duplicated on the page. Closer inspection reveals that menuTemplate is different on current OOTB instances indicating an update in the last 5 years (as you'd expect).