Hi All!
I have a client who asked the following:
“Are we able to just have a search button that brings someone directly to the search page to enter their search, can we have it pre-populate answers (but without anything entered in the search bar)? Something like the attached screenshot.”
Essentially, they do not want a search bar on their home site, but rather just a button that brings users to the Search Results Page and loads and empty search bar and surfaces some FAQs. I have two questions based on this:
- Is configuring something in this way possible?
- Are we able to control what entities and results populate on initial page load?
Thanks for your help!
Hi @Christopher_Siraucsa ,
Great question. We don’t support showing all results or entities on Universal search today but it’s on our radar for the future. As an alternative option here, we do support showing all results/entities on Vertical search. Depending on the goals/desired results and entities on initial page load are for your client, you could have the redirectUrl direct to a vertical specific tab (e.g., /faqs.html). From there, you can configure the Vertical Search to show all results with empty search by following the below steps:
1. Set up your Search Bar component to allow empty search.
On verticals, we will automatically show all results if a user conducts an empty search. By adding "allowEmptySearch": true
, we allow this behavior. You’ll find this in the componentSettings
object in your pages’s config.json file.
"SearchBar": {
"placeholderText": "Search for FAQs", // The placeholder text in the answers search bar
"allowEmptySearch": true
},
2. Set a default initial search to that empty search.
Now that we’re allowing an empty search, we can set that as the default when someone lands on the page. You can find this within pageSettings
in the search
object.
"pageSettings": {
"search": {
"verticalKey": "faqs", // The vertical key from your search configuration
"defaultInitialSearch": "" // Enter a default search term
}
},
Let me know if you have any questions and if that helps. If you’d like to see more info on customizing pages and the above settings check out: Customizing Pages Module
Best,
Alyssa