Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to print article from Service Portal.

niveditakumari
Mega Sage

Hi,

 

I should be able to navigate as an end user to an article and be able to click on something that allows me to print the article (without printing the entire webpage). 

When we open article on Service Portal and click on ctrl + P to print article then it is printing other things like Impersonate, Logout, Tours, I don't need this things to print. I need only KB article to be printed. 

I have done ctrl + P and it is printing many things. Please see attached screenshot. 

 

niveditakumari_0-1687197044540.png

 

Can anyone please help me how to print article instead other things. 

 

Regards, 

Nivedita

 

 

 

1 ACCEPTED SOLUTION

Community Alums
Not applicable

Hello @niveditakumari ,

 

Please refer this share project "Add wordcount and print functionality on knowledge article (Portal)".

URL: https://developer.servicenow.com/connect.do#!/share/contents/2421893_add_wordcount_and_print_functio...

 

Go to this URL and download the update set and commit it. This is for two things: to count words in the knowledge base and also have print functionality. So if you don't want word count, then remove or comment that part of the code of the widget.

 

OR pls refer:

https://www.servicenow.com/community/developer-forum/printing-knowledge-article/m-p/1484570

https://www.servicenow.com/community/now-platform-forum/printing-kb-article-from-service-portal/m-p/...

https://www.servicenow.com/community/developer-forum/how-to-add-printer-friendly-option-in-kb-articl...

 

 

@niveditakumariPlease mark my answer as "Accept as Solution" and "Helpfuls." If it works for you.

 

Thank you!

View solution in original post

13 REPLIES 13

Hello @Community Alums, 

 

I have downloaded that file. I follow to commit update set with retrieve update set but this is xml file. 

Can you please tell how to commit that file in my instance. 

It will show Knowledge Article Content(word/count) in widgets after committing this file then what is next step to achieve it. 

 

Regards, 

Nivedita

 

 

 

 

 

Community Alums
Not applicable

Hello @niveditakumari ,

Open any Knowledge Article in Service Portal, ctrl+ right click on that Knowledge Article u will able to see these options. SS:

Khushbookabra_0-1687692186789.png

 

Before it change your application scope to "Knowledge Management-Service Portal". Only if you are using service portal. SS:

Khushbookabra_1-1687692547796.png

 

Select "Instance in page editor" and then scroll down, instead of "knowledge Article Content" in sp_widget choose "knowledge Article Content(word/print)" widget and click on save.

 

Before:

Khushbookabra_4-1687693217860.png

U need to change sp_widget to "knowledge Article Content(word/print)" . SS:

Khushbookabra_5-1687693258857.png

 

 

Now u will able to see "print" icon in KB article. SS:

Khushbookabra_2-1687692878333.png

Click on it, U will able to print only knowledge Article:

Khushbookabra_3-1687692946459.png

 

 

@niveditakumariPlease mark my answer as "Accept as Solution" and "Helpfuls." If it works for you.

 

Thank you!

Hello @Community Alums, 

 

I have cloned Knowledge Article Content widget and added below code to client controller in that cloned widget Knowledge Article Content Print widget. 

 

niveditakumari_0-1687720277190.png

 

I have added Knowledge Article Content Print widget in instance in page editor. 

It is not working. It is now showing print icon. 

 

niveditakumari_1-1687721290494.png

niveditakumari_2-1687721334897.png

 

Can you please help me to achieve it. 

 

Regards, 

Nivedita 

 

 

Community Alums
Not applicable

@niveditakumari , You don't need to do that where I mentioned cloning and adding the client controller. Only you need to change the widget (sp_widget) in the instance page editor from "knowledge Article Content" to "knowledge Article content (word/print)". Please read the above steps carefully and try to follow them accordingly.

Community Alums
Not applicable

@niveditakumari , For to commit, pls go to " retrieved update set" application menu then on import update set from xml option upload the update set. SS:

Khushbookabra_0-1687800851454.png

Then pls go to "update set to commit" application menu. Select Knowledge_content_page_wordcount_print update set and run Preview and then commit it.

 

Thank you!