logo

NJP

Service Portal- Content Item ICON

Import · Aug 01, 2022 · article

Problem Statement:

When we search content items in typeahead search then the icon is not visible.

To illustrate here is my content item

It has the icon attached to it.image

Let us search this in our Service Portal and see what is available to us OOB.

image

So we don't see the icon getting displayed.

If there is a requirement in which they want to see the icon then we can fulfill this through following Steps:

  1. The OOB configuration can be found in Search Source module, so we will be manipulating that for our purpose. Go to Service Portal< Search Sourcesimage
  2. Open the record named Catalogs.image
  3. In the search page template add the piece of code below this line of code**
 <i ng-if="item.icon" class="ta-img" style="background-image:url('{{item.icon}}?t=small') ; width: 30px; height: 30px; line-height: 20px; background-size: contain; display: inline-block; background-repeat: no-repeat; background-position: center center; text-align: center; float:left; padding-right: 8px;"></i>
    <i ng-if="!item.icon" class="fa m-r-sm fa-file-text-o"></i>

The updated template would be something like below

image

Make sure you have commented the line {}.

After the update made, click save and give it a search again.

image

We have the associated icon displayed.

Hope this helps, Happy Learning.

View original source

https://www.servicenow.com/community/now-platform-articles/service-portal-content-item-icon/ta-p/2315811