- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2018 09:40 PM
I have links that only open in the current window. I need them to open in a new window or tab.
The ability to use the target field in the dictionary is gone, so I cannot use _blank there anymore.
What are my options to getting this to open in a new window?
Do I need to script it? If so where, I'm a little lost after googling everywhere for something I thought would be relatively simple...
Ta.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2018 07:24 PM
This got solved here:
https://community.servicenow.com/community?id=community_question&sys_id=a6b2ca9bdb98db445322f4621f961989
basically I needed help finding where to put the target="_blank" for the href in the widget html.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2018 10:55 PM
Hi Walshy,
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.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2018 11:08 PM
Thanks for that Vikram,
Just quickly though, will that load the link in the variable URL I have, my brain is trying to tell me your set up would only load google but that is just nuts.
I am assuming just following through your instructions will allow that field to be modified and then saved. Thus the new link will then be able to be opened in a new window.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2018 11:13 PM
Whatever link you are providing in the field it'll be opened in a new window.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2018 07:24 PM
This got solved here:
https://community.servicenow.com/community?id=community_question&sys_id=a6b2ca9bdb98db445322f4621f961989
basically I needed help finding where to put the target="_blank" for the href in the widget html.