This doc offers step-by-step instructions on how to add a Promotion vertical to a Search experience. This vertical can be used to highlight content by displaying a promo banner based on certain queries that are searched.
Note: If you want to add a static alert banner that always appears regardless of the results returned, see this doc!
On a high level, the process goes as follows:
- Add Promotion Entities to the Knowledge Graph
- Add the Promotion Vertical to the Search Backend
- Add the Promotion Vertical to the Search Frontend
Step 1: Add Promotion Entities to the Knowledge Graph
- Add a Promotion custom entity type. If you need a refresher, view this. We recommend that you add the following fields:
- Name
- Description
- CTAs
- URL
- Photo
- Keywords
- Add promotion entities to the account. Make sure the custom entity type is enabled. You can learn more about how to upload data into the Knowledge Graph here.
Step 2: Add the Promotion Vertical to the Search Backend
- Navigate to your Search Configuration and select Verticals.
- Add a Promotion vertical.
- By default, the
nameandbuiltin.entityTypeare set as searchable fields. However, if there are other terms or queries where you want to return the banner, you can do the following:- In the Searchable Fields section, add the
keywordsfield and select Phrase Match. This will trigger the result only if the keyword, or "phrase", is contained in the query.
- In the Searchable Fields section, add the
-
Navigate to the Query Rules screen. Add the following query rule:
- Name: Boost Promotions
- Criteria: Search Type = Universal
- Action: Boost Verticals = Promotions
This query rule will boost the promotions vertical to the top of your universal search for any query where promotion entities are returned.
Step 3: Add the Promotion Vertical to the Search Frontend
- Navigate to your Search frontend (Pages > Your Site). In your Pages code, add the following to your
index.jsonfile under theverticalsToConfigobject after "Universal":
"promotions": { // The vertical key from your search configuration
"label": "", // The name of the vertical in the section header and the navigation bar
"hideInNavigation": true, // hides navbar tab
"universalLimit": 1, // ensures only one result
"cardType": "promo-card" // forked card name
}
- Fork a promo card from the
card/standardtemplate card folder. Name it "promo-card" per the abovecardTypeconfiguration. Style it however you want! - In the
answers.scssfile, hide the navigation bar and view all section for this vertical.
.HitchhikerResultsStandard--promotions {
.HitchhikerResultsStandard-title {
display:none;
}
.HitchhikerResultsStandard-viewMore {
display:none;
}
border-top: var(--yxt-border-default);
}
- Optionally, add a light background brand color to highlight the promo cards. Add this to your
answers.scssfile:
.HitchhikerStandard.promo-card{
background-color: #bfe8f8;
}
The result should look something like this:

