How to Customize the Insert/Edit Link Dialog in Knowledge Article Editor?

Daniel Vieira
Tera Expert

Hi everyone,

 

I'm currently working on customizing the article creation experience in the Knowledge module. One of the features available in the rich text editor is the Insert/Edit Link option (alongside Remove Link). As shown in the image below:

 

html_editor_link.png

 

When clicking the Insert/Edit Link button (or using Ctrl + right-click on selected text), a UI Page named html_insert_link_dialog is triggered and displayed.

 

I'd like to override this behavior so that, instead of loading the out-of-the-box html_insert_link_dialog, it opens a custom UI Page that I will create.

 

The challenge is that I haven't been able to locate where the redirection to this UI Page is configured. I need to understand what triggers the editor to load html_insert_link_dialog, so I can replace it with my own.

 

Has anyone customized this before or knows where the configuration or redirection logic to this UI Page is defined?

 

Thanks in advance!

 

 

 

1 ACCEPTED SOLUTION

@GlideFather

I found a new solution to meet my requirement regarding article URLs.

Initially, I thought about customizing the Insert/Edit Link UI Page to redirect user-entered URLs to a new UI Page. However, after further analysis, we concluded that this approach wasn’t feasible.

Instead, I came up with a better and cleaner solution: using a Business Rule.

Here’s how it works:

  1. When someone creates an article that contains an <a href> tag, the Business Rule is triggered.

  2. Using a regular expression (RegExp), the rule finds and replaces the original URL (entered by the user) with the new target URL.

  3. The modified content is then updated directly in current.type (which represents the article body).

This approach allowed me to meet the requirement without needing to heavily customize the UI Page.

Hope this helps someone facing a similar challenge!

 

Thanks,

Daniel Vieira

View solution in original post

11 REPLIES 11

@GlideFather

I found a new solution to meet my requirement regarding article URLs.

Initially, I thought about customizing the Insert/Edit Link UI Page to redirect user-entered URLs to a new UI Page. However, after further analysis, we concluded that this approach wasn’t feasible.

Instead, I came up with a better and cleaner solution: using a Business Rule.

Here’s how it works:

  1. When someone creates an article that contains an <a href> tag, the Business Rule is triggered.

  2. Using a regular expression (RegExp), the rule finds and replaces the original URL (entered by the user) with the new target URL.

  3. The modified content is then updated directly in current.type (which represents the article body).

This approach allowed me to meet the requirement without needing to heavily customize the UI Page.

Hope this helps someone facing a similar challenge!

 

Thanks,

Daniel Vieira

JessicaLanR
Kilo Guru

Hi there,

The behavior you're describing is part of the TinyMCE configuration that ServiceNow uses for the Knowledge rich text editor. The html_insert_link_dialog UI Page is hardcoded into the editor's plugin setup and is invoked through internal JavaScript loaded as part of the TinyMCE integration, which is not directly exposed in a way that allows simple configuration changes.

Unfortunately, there's no official system property or configuration record that allows you to override the link dialog UI Page directly through Studio or the UI. To customize this behavior, you would likely need to override the entire TinyMCE editor configuration, which can be risky and unsupported by ServiceNow, especially across upgrades.

That said, one workaround some developers explore is injecting custom scripts or creating a custom UI macro/editor component and replacing the default editor entirely for specific use cases. However, this requires careful planning, as it can impact the editor behavior platform-wide if not scoped correctly.

If you're customizing the Knowledge module in a scoped app or via a custom application, consider using your own form and editor setup where you control the components fully.

If this helps or points you in the right direction, feel free to mark the answer as solved to help others in the community.