- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-20-2019 07:32 PM
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
Solved! Go to Solution.
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-20-2019 09:32 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-20-2019 09:32 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2019 12:11 AM
worked perfectly.Thanka a lot 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2019 12:14 AM
Great!!!
Can you please mark my response as correct answer and close this thread?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2019 12:49 AM
Hi Ali,
Thanks for the Quick reply.
Now I am able to see the results.Now I am having search Page(widget) in Search Results.
When I click on the item in Search results it is taking me to the Default service Portal Page instead of my custom page
How ever I didnt find code for navigation from Search Page to Catalog Item Page.
Is the navigation part is coming from search source?
Thanks.