Service Portal Search results Navigation

Akil
Kilo Expert

Hi All,

I customized the new search Page (custom service portal), and I cloned the typeAhead search widget.

How the navigation is being done in  type Ahead search widget  to Navigate to Search results Widget.

Can you help what piece of code is helping in Navigation.

I want to Navigate to new search results page created by me from  the typeahead search widget(cloned).

Thanks,

Akhil

1 ACCEPTED SOLUTION

Alikutty A
Tera Sage

Hi,

On your cloned typeahead widget, please make the following changes to your custom search page and see if get linked to each other.

1) On the client script

c.submitSearch = function() {
var shouldReloadPage = c.data.refreshPageOnSearch && $location.search().id === 'replace_id_of_search_page_here';

if (c.searchTerm) {
var newUrl = $location.search({
id: 'replace_id_of_search_page_here',
spa: '1',
t: c.searchType,
q: c.searchTerm
});

2) On the Server script

if ($sp.getParameter("id") == "replace_id_of_search_page_here" && $sp.getParameter("t")) {
data.searchType = $sp.getParameter("t");
searchSources = $sp.getSearchSources(data.portalID);
}

Replace replace_id_of_search_page_here with your custom page id

View solution in original post

11 REPLIES 11

Yes there is Page option within the search source for knowledge articles in the typeahead settings. Check this tab in your knowledge search source.

find_real_file.png

Akil
Kilo Expert

Got the Code for this as well.

In Search source : add 

var item = {};
item.type = "sc";
item.page = "PageName";

Yes this one is for catalog and above one is for knowledge

Not sure why you changed the correct answer?? If your initial query was resolved by my response, please mark my response as the correct one. Thanks!

Akil
Kilo Expert

Sorry Ali,Yes the Initial answer is correct and I marked it as correct now.