Print widget in service portal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2018 10:08 AM
As of now in my org people use ctrl+p to print the knowledge article but it is printing all the unnecessary things like Top rated , top viewed etc ..
Our requirement is to
add a button(widget) at the bottom of the KB Articles that can be clicked to print just the KB article content,, I found this article below where we can add the print image code in the KB article widget but we don't want to clone our KB article page ,,
https://community.servicenow.com/community?id=community_question&sys_id=54c2dba1db101fc01dcaf3231f961963&view_source=searchResult
Our requirement : how to print the KB article content by clicking print (widget ) can some one help me with the code

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2018 10:19 AM
You can enable print functionality with below code in your widget.
using this HTML:
<a href="{{data.ticketPrint}}" target="_blank" class="panel-button" title="Print">
<span class="glyphicon glyphicon-print"></span>
</a>
and corresponding server script:
var u = data.table + '.do?sys_id=' + data.sys_id;
data.ticketPrint = '/' + u + '&sysparm_media=print';
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2018 11:07 AM
server side : I checked with below both
(function() {
/* populate the 'data' object */
/* e.g., data.table = $sp.getValue('table'); */
})();
var u = data.table + '.do?sys_id=' + data.sys_id;
data.ticketPrint = '/' + u + '&sysparm_media=print';
and
(function() {
/* populate the 'data' object */
/* e.g., data.table = $sp.getValue('table'); */
var u = data.table + '.do?sys_id=' + data.sys_id;
data.ticketPrint = '/' + u + '&sysparm_media=print';
})();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2018 01:10 PM
Any other suggestions please
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2018 10:27 AM
any other suggestions please?