Typehead Search customize

JuliaWeis98
Giga Contributor

Hi guys, 

 

is there a ways to configure the typehead search widget? Because when i search something and press enter, a new page called "search" opens.

JuliaWeis98_2-1762520581377.png

 

JuliaWeis98_1-1762520556140.png

 

My goal is, that the result page (id=search) appears under my Searchbar like this:

JuliaWeis98_0-1762520448115.png

 

This is my customized typehead search widget. But is there an easier way without cloning and customizing this widget?

2 REPLIES 2

YaswanthKurre
Tera Guru

Hi @JuliaWeis98 ,

 

 

When a user presses Enter, the widget executes a full query and relies on the platform's standard mechanism to route the search term (q=) to the portal's dedicated Search Page (id=search). This redirect behavior is hard-coded into the widget's Client Controller. There is no simple widget option that allows you to change the target page ID for the Enter key submission.

 

If you want it to display under search , you have to clone and customize the widget. That is the best option and there is no OOB way to achieve that.

 

Mark this as helpful and correct, if this helps you.

 

Thanks,

Yaswanth

ChrisBurks
Giga Sage

This can be achieved without cloning the widget. Instead use page route maps. 

What page route maps will do is automatically re-route your end page to the page you desire. Keep in mind though this will be for your whole portal. 

Steps:

  1. Navigate to All > Service Portal > Page Route Maps
  2. There might already be a page route for the search result page so under the "Route from" column filter on the word "search"
  3. Look under the "Service Portal(s)" column to see if a map already exists for the desired portal
  4. If there is take note of the "Order" number. 
  5. Click the "New" button in the top right of the list view to start to create your page route
  6. Fill out the fields appropriately
    1. Short description: this is just the name of this record
    2. Service Portal(s): This is a list collector to add the portals you want this route to apply to
    3. Route from: This refers to the current page your results land on
    4. Route to: This would be the page you want it to end up on
    5. Active: Of course make sure it's active
    6. Order: This number should be smaller than the number if a map already exists and is used on the same portal as you desire
  7. Save your record

 

Navigate to your Search page and perform a search to test

 

Working example:

search_page_route.gif

 

Note: Depending upon what your use case is I don't think this would be the best portal experience. But as a standalone one off search maybe. If this is needed but you don't think the page route fits, there are still other ways to make this happen without cloning the OOB search widget.