Hide Verticals from Universal Search Page

Hello!
Is it possible to hide certain verticals from the Universal Search page? OR is it possible to add a filter to the Universal Search Page for just 1 vertical?

I have a unique use case where I am using all 1 entity type but have multiple filters to differentiate and create verticals. This results in duplicated content in Universal Search since the entity is in both a specific vertical and the original, catch all vertical.

I’ve followed this community post to change the Universal Search page into a Vertical Page but unfortunately then that limits the ability to search in other Vertical Pages and removes the Navigation Bar. I’ve also tried to add a filter within query rules to filter but that did not seem to work either.

I’d love to find out best practice for this.

Thanks for your insight!
Adrienne

Hi Adrienne,

Since the catch all vertical has all the content for this entity type, but there are entities that may not fall in the categorical verticals, you could display only the catch all vertical on universal search and hide all the categorical verticals. This way, all content could only show up once in universal search. To hide the vertical results in universal search, you’ll want to add the following CSS to the answers.scss file for each vertical:

.HitchhikerResultsStandard--[verticalKey] {
  display: none;
}

If you’re using different page templates (such as vertical map), you need to update HitchhikerResultsStandard to match that template.

Hope this helps!

Thanks so much for the directions Kristy! I just want to point out for anyone that uses this post as a guide, don’t actually type in the brackets around the verticalKey when trying to implement this code. For example, in practice this might look like:

.HitchhikerResultsStandard–faqs {
display: none;
}

This may be self-explanatory for others, but I personally didn’t realize this and was very confused as to why it wasn’t working until I figured it out, so I just want to make sure no one else runs into that mistake.

5 Likes