Working around for paste link issue: Is it possible to search for an html attribute in all articles?

amarks
Tera Expert

When we type a URL into the KB article resolution, we don't have an issue.

 

If we paste a URL into the KB article resolution, the link tries to open internally (in the same window) and won't display.  The manually work around is to edit the article link and change the target to "New Window."  The solution is essentially to ensure that the link has the <a> reference to target="blank" (which is the function that editing the link using the drop-down does. However, we need to identify the articles in our knowledgebase that contain links without this attribute.

 

Is there a way to search all the articles in the KB for links that are missing this html attribute?

 

Thanks,

Adam

 

 

The challenge is that we have an unidentified number of articles that have

1 ACCEPTED SOLUTION

Brad Bowman
Kilo Patron
Kilo Patron

You can add the Article Body to a list view of the kb_knowledge table, then filter on something like Article Body contains href AND Article Body does not contain target="_blank". This won't show you the articles with more than one link where one has this and the other(s) do not.

View solution in original post

5 REPLIES 5

Brad Bowman
Kilo Patron
Kilo Patron

You can add the Article Body to a list view of the kb_knowledge table, then filter on something like Article Body contains href AND Article Body does not contain target="_blank". This won't show you the articles with more than one link where one has this and the other(s) do not.

Thanks for taking a look, Brad. I'm seeing articles where the url has been explicitly typed

"Click this link for the ServiceNow Community: https://www.servicenow.com/community"

but, unfortunately, when the link has been pasted, the search doesn't look past the link display text to the underlying html: "Click this link for the ServiceNow Community."

 

Any other thoughts on this?

Hi, I found an article in my KB that has both of the examples you show in your reply. 

Kim27_0-1698261498445.png

I was able to identify articles where the link has been pasted by doing the following:

  1. Filter navigator> Knowledge> Published
  2. Add "article body" to the list of columns using the gear. 
  3. Search for *href in the column search
    Kim27_1-1698261796741.png
  4. Add any other filter parameters needed. 
  5. You can export this view by right-clicking on the header and clicking "export". 

I hope this gets you what you want! 

Thanks, Kim. Your post spurred me to retry Brad's solution and it does help, so thanks for pointing that out.