Open KB article in new tab when we search in portal
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2025 09:25 AM
Hi Team,
I have a catalog item, So in description field if i have entered particular keyword, it is displaying related kb articles. But when I open the KB that need to be open in a new tab.
could any one help me how this is configured and what I should do to open hem in different tab.
Thank you in advance,
Regards,
Deepthi P
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2025 10:04 PM
Hello @Deepthi24,
To open Knowledge Base (KB) articles in a new tab when searching in a Service Portal in ServiceNow, you can modify the HTML of the search results or the KB article links themselves. You'll need to add the
target="_blank"
attribute to the anchor tags (<a>) of the links. This tells the browser to open the link in a new tab or window.
Here's a more detailed breakdown:
1. Modifying Search Results:
-
Identify the HTML structure:Determine how the KB article links are rendered in the search results. You might need to inspect the HTML of the search results page or look at the SP widget code used for displaying the search results.
-
Add
target="_blank"
:Modify the anchor tags (<a>) of the links to include thetarget="_blank"
attribute. For example:
Code
<a href="/sp?id=kb_article&sys_id=your_kb_article_sys_id" target="_blank">KB Article Link</a>
This ensures that when users click the link, it will open the KB article in a new tab.
2. Modifying KB Article Links (if necessary):
- Edit the KB article content: If you can edit the KB article content itself (e.g., if you have permissions to edit the HTML of the article), you can add
target="_blank"
to any links within the article that should open in a new tab. - Example:
Code
<a href="http://www.example.com" target="_blank">Visit Example.com</a>
3. Additional Considerations:
rel="noopener noreferrer"
: Consider addingrel="noopener noreferrer"
to the anchor tags for added security and to prevent potential browser issues.
Code
<a href="/sp?id=kb_article&sys_id=your_kb_article_sys_id" target="_blank" rel="noopener noreferrer">KB Article Link</a>
-
Service Portal Widget:If the search results are displayed using a specific Service Portal widget, you might need to modify the widget's code to add the
target="_blank"
attribute. -
AI Search:If you're using AI search, ensure that the AI search results are also configured to open in a new tab, especially if the AI search functionality modifies the way KB articles are displayed.If this is helpful, please hit the thumbs up button and accept the correct solution by referring to this solution in future it will be helpful to them.Thanks & Regards,Abbas Shaik