Service Portal: Typeahead search - need to change the target page for typeahead KB results

John Tomko
Tera Expert

Our company has multiple service portals, and we need a different experience for each.  We're using the OOTB widget "Typeahead Search" to retrieve both catalog items and KB articles.  We need results for KB articles to link to a custom page "kb_article_view".  We've modified the HTML template for the Search Source the portal is using so it references the correct page once the user is on the search results page.  However, we cannot figure out how to tell the typeahead widget what page to use when a user clicks on a row in the drop-down that generates when the user is searching.

find_real_file.png

We've looked at service portal config as well as the OOTB typeahead-search widget and its two templates, and have not found the answer.  Any thoughts?

Thanks!

1 REPLY 1

John Tomko
Tera Expert

Looks like I figured it out.  I was looking for something similar to the Search page template on sp_search_source, and just found the advanced typeahead config.  Still have some formatting to do, but this looks like it'll do the trick:

 

<div>
  <a href="?id=kb_article_view&amp;sys_id={{match.model.sys_id}}"
    <i class="fa fa-book m-r-sm"></i>{{match.model.short_description}}
    <span ng-bind-html="highlight(item.short_description, data.q)"></span></a>
  <p ng-bind-html="highlight(item.text, data.q)"></p> 
</div>