Most Viewed Knowledge Articles Widget on Service Portal

cnharris1
Kilo Sage

Good morning developers,

I'm building out our new Service Portal and want to display the most viewed knowledge articles using the "Most Viewed Articles" widget. It is working as intended but there is a knowledge article that is our most viewed but my customer doesn't want it displayed in the widget as the most viewed article for various reasons. I tried setting the view count back to 0 so it doesn't display and it works but the system resets it back to its previous number every night, making it the most viewed knowledge article again. Is there a way to script that knowledge article out from showing up in the widget or keep the view count at 0?

 

Thanks in advance,

 

cnharris

1 ACCEPTED SOLUTION

cnharris1
Kilo Sage

I just deactivated all records pertaining to that knowledge article and set the view count back to 0.

View solution in original post

6 REPLIES 6

Eitan_B
Tera Expert

try to retire the article and create a new one with the same content. 

rajneeshbaranwa
Giga Guru

Just add a query in your widget to exclude KB articles after z.addQuery("kb_category", options.kb_category); in server script.

 

Query will be something like : z.addQuery('number','!=','KBXXXXXX');

find_real_file.png

Hi rajneeshbaranwal,
 
Thanks for responding! My server script for that widget looks different from yours. Here's what mine has:
 
find_real_file.png

find_real_file.png

Can you show me your HTML section ? In HTML section you may add ng-if that if result.number is not KB number.