Inserting a Coveo Search Box to Your Header Using the Coveo for Sitecore Legacy Search UI
Inserting a Coveo Search Box to Your Header Using the Coveo for Sitecore Legacy Search UI
Coveo for Sitecore 4.1 (November 2018)
It’s usually a good idea to have a search box in your header that redirects to your search page, as it allows users to search through your website content from any page.
Requirements
-
You already have a Coveo-powered search page (see Inserting and Customizing a Search Interface Component or Inserting Coveo Search Components to an Existing Item).
-
You already have a header template with an available placeholder. For more information on placeholders, see The Power of Placeholder Settings.
Insert a Coveo Search Box
-
In the Sitecore Content Editor, navigate to your header template, usually located under Content > Templates.
-
Select the __Standard Values of your header.
-
Select the Presentation tab, and select Details.
-
Under Default, click Edit, opening the Device Editor window.
-
Select the Controls tab.
-
When adding Web Form components:
-
Select Add.
-
Navigate to Sublayouts > Coveo, and select Coveo Search Box Resources.
The
Coveo Search Box Resources
sublayout includes only the minimally required dependencies to include aCoveo Search Box
on a page. If you plan on adding Omnibox Result List components, you need to add theCoveo Search Resources
sublayout instead.-
In Add to Placeholder, enter the name of the placeholder in which to put your search box.
-
Click Select.
-
-
Select Add again.
-
Navigate to Sublayouts > Coveo, and select Coveo Search Box.
-
In Add to Placeholder, enter the name of the same placeholder as before.
-
Click Select, opening the Control Properties window.
-
In Id, enter a value, such as
CoveoSearchBoxId
. -
In Search page item, select the search page to which your search box redirects.
-
Click OK to close the Control Properties window.
-
-
Select OK to close the Device Editor window.
-
Select OK to close the Layout Details window.
-
-
When adding MVC components:
-
Select Add.
-
Navigate to Renderings> Coveo, and select Coveo Search Box View Resources.
The
Coveo Search Box View Resources
rendering includes only the minimally required dependencies to include aCoveo Search Box
on a page. If you plan on adding Omnibox Result List components, you need to add theCoveo Search View Resources
rendering instead.-
In Add to Placeholder, enter the name of the placeholder in which to put your search box.
-
Click Select.
-
-
Select Add again.
-
Navigate to Renderings> Coveo, and select Coveo Search Box View.
-
In Add to Placeholder, enter the name of the same placeholder as before.
-
Click Select, opening the Control Properties window.
-
In Id, enter a value, such as
CoveoSearchBoxId
. -
In Search page item, select the search page to which your search box redirects.
-
Click OK to close the Control Properties window.
-
-
Select OK to close the Device Editor window.
-
Select OK to close the Layout Details window.
-
-
Save your __Standard Values item.
-
Test that your search box is present in your header.
-
Navigate to one of your content items in which your header is present.
-
Select the Publish tab, and click Preview.
-
What’s Next?
As you may notice, the search box is too big for the header. Therefore, you may want to start Inserting Custom CSS.