How to set a default for opening URLs in a new window

vidhya8
Tera Contributor

When creating Knowledge the URLs always open in the ServiceNow window. This is because the URL target is set to None (use Implicit)

url_open.PNG

Is there a way to set the target to 'New Window' so that the link always opens in a new window?

Appreciate any help on this.

Thanks

Vidhya

11 REPLIES 11

I didn't use the editor to add the code, just to figure out the extra space (clicking on the image shows the full line of code in the template):



How it looks in the templatelink target html.png
How it renders in the knowledge formlink target html 2.png

I'm sorry - you're right. Our template includes other code, like linking to CSS. When I glanced at just this piece of the code in the html editor, there are no paragraph tags around it; but now that I look more carefully, there is one paragraph tag around the entirety of the code. ServiceNow is new to us, so no one has noticed the extra space. Our writers are just relieved that they now no longer have to go through the work of editing each hyperlink as we copy/paste our articles from our older systems to ServiceNow. I have been considering adding a box around the article, to make it look nicer when someone finds an article through a search in the ESS. That might also help visually with the extra space.


This thread is a few years old, so I'm wondering if the solution you came up with was for Knowledge V2 or V3?  We are on V3 and are working with the new Knowledge Article templates (how to, faq, what is, and KCS article) in addition to the Standard template.  I was not able to find how to do this with the V3 templates.  Do you have any advice on that?  Thanks!


Susan Williams, Lexmark

Michael QCKM
Tera Guru

I found this: https://hi.service-now.com/kb_view.do?sysparm_article=KB0682662

Change the default 'Insert Link Target' from 'None (use implicit)' to another option such as 'New window (_blank)'

How to change the TinyMCE's default 'Insert Link Target' from 'None (use implicit)' to another option such as 'New window (_blank)'

Description

This article details how to customize the TinyMCE's Insert/Modify Link functionality to change the default Target: 'None (use implicit)' to another option such as 'New Window (_blank)'

Solution

  1. Navigate to the UI Page "html_insert_link_dialog"
  2. On the HTML field of this record scroll to around line 45/46 where it says:
    <g2:ui_select_option text="${gs.getMessage('None (use implicit)')}" value="" selected="$[jvar_selected_target]" />
  3. Change the value attribute of the line from:
    value="" to value="_self"
    *Value of empty and value of _self are the same. The reason why we're doing this is so the system will not default to this option. It will always default to an option that has value=""
  4. Now pick any other option that you want to be the new default and move this to the top, replacing the position that "None (use implicit)" previously occupied. It should look like this:
  5. Save the change and now when using the Insert/Modify Link functionality, it should now default to Target: 'New window (_blank)' (assuming this was the option you've selected to be the default)

Applicable Versions

All versions that use TinyMCE

Additional Information

Please note that this will customize the OOB "html_insert_link_dialog" UI Page so if ServiceNow updates this UI Page in the future, that update to this UI Page will be skipped. You may consider reverting back to OOB prior to upgrading the instance if you'd like to receive the ServiceNow update to this UI Page and then re-apply the customization after.

Article Information

Last Updated:    2018-04-03 21:17:04
Published:           2018-04-04

Has anyone figured out how to do this with the upgraded TinyMCE in Tokyo? It's defaulting back to "None (Use Implicit)".  We would like "New window (_blank)" to be the default (i.e., top of the list).

 

susanwinky_1-1673391424071.png

 


Susan Williams, Lexmark