Integrating new knowledge portal pages with the service portal

Using the base system service portal, access the improved version of the knowledge portal that features an enhanced landing page with multiple knowledge bases, an article view page that includes new article widgets, and the search results page that displays global knowledge search results.

To access the enhanced knowledge portal pages from the service portal, as a system administrator, you can configure the following in the service portal:
Note: The knowledge portal page integrations described in this section can only be performed in the base system service portal.

Configure the knowledge header menu and tile widget

Access the new knowledge portal home page using the Knowledge header menu and the Knowledge Base tile widget in the service portal.

Before you begin

Role required: admin

Procedure

  1. Configure the Knowledge header link to point to the knowledge portal home page.
    Figure 1. Knowledge link on service portal header
    To configure:
    1. Navigate to Service Portal > Portals.
    2. In the Service Portals list, select the Service Portal record.
    3. In the KB home page field, enter kb_home.
    4. Click Update.
    When you click Knowledge in the service portal header menu, it takes you to the knowledge portal home page.
  2. Configure the Knowledge Base tile widget to link to the knowledge portal home page.
    Figure 2. Knowledge tile widget
    To configure:
    1. Navigate to the service portal page.
    2. Control + right-click the knowledge base tile widget and select Instance Options.
      The Knowledge Base form appears.
    3. In the Page field, change the value from kb_view to kb_home.
    4. Click Save.
    When you click the Knowledge Base tile widget in the service portal page, it takes you to the knowledge portal homepage.

Configure the knowledge portal URL to link to the article view page

Use the service portal to access the new knowledge portal article view page that features type ahead search and a highly configurable search results page.

Before you begin

Role required: admin

About this task

You must configure the type ahead knowledge portal link and knowledge global search results link in the knowledge base search source and in the service catalog search source, to point to the Knowledge Management Service Portal article view page.

Procedure

  1. Complete the following steps to configure the type ahead knowledge portal link and the knowledge global search results link in the knowledge base search source.
    1. Navigate to Service Portal > Search Sources and click the Knowledge Base search source.
    2. In the Search page template field, change the following line of code from:
      "?id=kb_article_view&sys_kb_id={{item.sys_id}}"
      to "?id=kb_article&sys_id={{item.sys_id}}"
    3. In the Data Source tab, go to the Data fetch script field and add the following line of code:

      article.url = '?id=kb_article_view&sys_kb_id=' + kb.sys_id;

    4. Right-click the form header and click Save.
  2. Complete the following steps to configure the type ahead knowledge portal link and the knowledge global search results link in the service catalog search source.
    1. Navigate to Service Portal > Search Sources and click the Service Catalog search source.
    2. In the Search page template field, change the href tag to the following:

      <a ng-if="item.content_type == 'kb'" ng-href="?id=kb_article&sys_id={{::item.kb_article}}" class="h4 text-primary m-b-sm block">

    3. In the Data Source tab, go to the Data fetch script field and change the code in line 45 to the following, as shown in image below:

      item.url = '?id=kb_article_view&sys_kb_id=' + kb.sys_id;

  3. Click Update.
    The knowledge results from type ahead and global search in the service portal point to the new knowledge portal article view page.

What to do next

Enable search on all knowledge bases.

Add a knowledge search widget to the Service Portal

Create and add a new widget to the service portal search results page to navigate to the enhanced knowledge search results page.

Before you begin

Role required: admin

About this task

Create and add a Search Within knowledge widget to the service portal and link it to the Knowledge global search results page.

Procedure

  1. Create a new widget with the name Search Within using the following settings:
    Table 1. Field values to create a new knowledge search widget
    Field Value
    HTML Template
    <div role="list" class="list-group">
      <span class="list-group-item active">${Search Within}</span>
      <a role="link" class="list-group-item" ng-href="{{data.url}}">${Knowledge}</a>
    </div>
    Server Script
    (function() {
    	var q = encodeURIComponent($sp.getParameter('q'));
    	var kb = $sp.getValue('kb_knowledge_base') || "";
    	data.url = '/sp?id=kb_search';
    	if(q)
    		data.url += "&keyword="+q;
    	if(kb)
    		data.url += "&kb_knowledge_base="+kb;
    })();
  2. Add the widget to the service portal search results page.
    To add the widget:
    1. Navigate to the service portal search page (https://<instance>.service-now.com/sp?id=search) in designer mode.
    2. In the Filter Widget search box, search for the Search Within widget and drag it into the container in the location you want the widget to appear in the service portal search results page.
      Note: You can click Preview to verify the location and appearance of the newly added widget.
    The Search Within widget is added to the service portal search results page. In the service portal, when you click Knowledge in the Search Within widget, and search for a keyword, it redirects you to the knowledge global search results page.

Add knowledge quick-access widgets

Add Featured Articles, Most Useful Articles, and Most Rated Articles knowledge widgets to the service portal page.

Before you begin

Role required: admin

About this task

Replace the existing Top Rated knowledge widget in the service portal with one or more of the knowledge quick-access widgets.
The following knowledge quick-access widgets are available to be added to the service portal:
  • Featured Articles
  • Most Useful Articles
  • Most Viewed Articles

Procedure

  1. Navigate to the service portal home page in designer mode.
  2. In the Filter Widget search box, search for the widget you had created and drag it into the container in the location you want the widget to appear in the service portal home page.
    Note: You can click Preview to verify the location and appearance of the newly added widget.
    When you click a link in the newly added quick-access widget from the service portal, it takes you to the knowledge portal page.