How to apply << target="_blank" rel="noopener noreferrer" >> to every LINK(URL) in the knowledge articles?

MaO2
Tera Contributor

In our team, when we make knowledge articles, we import word documents to a knowledge base and apply CSS to arrange the appearance.

We also want to apply << target="_blank" rel="noopener noreferrer" >> to every LINK(URL) in the knowledge articles.
*Not only target="_blank" but also rel="noopener noreferrer" is needed.

Anyone know how to do it using CSS, Scripts or other ways?
I mean, we want to make it without the word authors setting << target="_blank" rel="noopener noreferrer" >> to each links.

Thanks.

1 ACCEPTED SOLUTION

okay so you click a article from Most viewed widget correct. If that's the case go to widget search for KB Most viewed widget and in HTML part look for this line

<a href="?id=kb_article&sys_id={{::a.sys_id}}">{{::a.short_description}}</a> // you need to add target="_blank" to open in new tab

clone the widget replace the below line and add the cloned widget to your portal page

<a href="?id=kb_article&sys_id={{::a.sys_id}}" target='_blank'>{{::a.short_description}}</a>

 

 

 

Regards
Harish

View solution in original post

6 REPLIES 6

Harish KM
Kilo Patron
Kilo Patron

If i understand correctly. You want articles to be opened in new tab when we click on that? Are you using Service Portal?

Regards
Harish

MaO2
Tera Contributor

Thank you for your reply.

Yes, that's right.

I want articles to be opened in new tab(or new page) when we click on that.

We use Service Portal.

okay where are you clicking the article from portal? For this we need to edit the widget and look for html script in widget

 

example:

find_real_file.png

 

Regards
Harish

MaO2
Tera Contributor

I am sorry I don't understand what you mean by "where are you clicking the article from portal?".

I see the knowledge on the portal, so, I will click the article from the portal.

I want to add target="_blank" rel="noopener noreferrer" to URLs when I import a word (1) in our procedure) or when I see the published article (3) in our procedure).

--------our procedure

1) Import a knowledge written in a word. 

    there is URLs in a word without target="_blank".

    ex)  Servicenow login page : https://devxxxxx.service-now.com

          or

          Servicenow login page  

find_real_file.png

2) publish the knowledge

3) See the knowledge from the portal > knowledge menu, then click the article from categories, Most Viewed Articles, the result of searching Knowledge, etc.

find_real_file.png