Display All Results on No Results | Yext Hitchhikers Platform
When a user can’t find a result in a Search experience, they are presented with a “no results” screen. This feature is common across search engines, both third party and first party.
This is the behavior for Universal Results screen by default. However, on vertical search only, you can choose to display all results for a vertical when no results are found. It would look like this:
Configuration
The NoResults
feature is part of VerticalResults
and is a unique sub-component since other components have settings for it. Most other components are self-contained.
In the Theme, page templates will have the No Results feature specified by default.
"VerticalResults": {
"noResults": {
"displayAllResults": true
}
To enable the advanced No Results UI you’ll need to do a few things in the config > [vertical].json
file:
- Enable it in
VerticalResults
inComponentSettings
- Specify how you want each component impacted by No Results to behave when there are no results. This includes:
- Pagination
- Map Configuration
Here’s what this could look like on a Vertical page with a Map and with Pagination:
{
"verticalKey": "Locations",
"pageTitle": "Location Search",
"componentSettings": {
"SearchBar": {
"placeholderText": "Search",
"title": "What are you looking for today?"
},
"VerticalResults": {
"noResults": {
"displayAllResults": true
}
},
"Pagination": {
"noResults": {
"visible": true
}
}
},
"verticalsToConfig": {
"Locations": {
"cardType": "location-standard",
"icon": "pin",
"mapConfig": {
"mapProvider": "MapBox",
"noResults": {
"visible": true,
"displayAllResults": true
}
}
}
}
}