Removing Searchbar from Search Results Page in Handlebars

Hi team, I’m testing the functionality of removing the search bar from certain verticals on an iFramed search results page. I’ve commented out
{{> templates/universal-standard/script/searchbar }}
and
{{> templates/universal-standard/markup/searchbar }}
from certain [pages].html.hbs files, and although this successfully removes the search bar, what I’m seeing is that verticals without the search bar don’t seem to send a query. This is true despite the fact that when I submit a query in a vertical with the search bar, then click to a vertical without a search bar, the URL param query=[query] is maintained. The networks tab of Chrome DevTools confirms that no query is actually being sent.

I know there are other ways to accomplish this functionality with the React Component Library, but is it possible to eliminate a search bar on certain verticals using Handlebars?

Thanks for your help!

Hi Jacob, I think the issue here is that the SearchBar is the component that actually fires the request, so if you comment it out I think that the request never gets sent.

I think you’d probably have an easier time accomplishing this in the React Component Library.

Hi Max, thanks for your response! I agree that the React Component Library would be the most straightforward way of accomplishing the desired functionality. However, there’s already a search results page built in our code editor and I do not believe the client is a React developer. I’ve provided React documentation and recommended implementing a VerticalResults React component, but I’m wondering if there’s a way to accomplish this in Handlebars.

Jacob,

I am working on a project with a similar design. Did you find a solution using just Handlebars, or did you need to React to solve your requirement?