Integrate a Hosted Search Page in a Sitecore Item

Coveo for Sitecore (June 12, 2020)

If you have created a hosted search page in the Coveo Administration Console, you can integrate that search page in your Sitecore website seamlessly by inserting the Coveo Hosted Search Page rendering in a Sitecore item. Once the Sitecore item web page is loaded, the Coveo Hosted Search Page component is initialized, at which time the content of the target Coveo Platform search page is fetched and injected into the page layout.

Coveo for Sitecore further eases the implementation process by providing an Example Hosted Search Page branch template that bundles a Sitecore item linked to a layout which already contains the Coveo Hosted Search Page rendering, and the rendering data source. This branch template may be used in a standard Sitecore site or in an SXA site.

Creating a search page item using the Example Hosted Search Page branch template

  1. In the Content Editor, right-click the parent of the new search page item and select Insert > Insert from template.

    Insert from template

  2. In the Branches/Coveo Hive/ folder, select the Example Hosted Search Page template and give your new item a name.

    New Example Hosted Search Page

  3. In the content tree, select the Example Hosted Search Page data source item.

    Select the data source

    If you’re getting an error in the Search Page field, see Required API Key Privileges.

  4. Select the Coveo organization search page you want to use from the Search Page Droplist and set a Search Hub value.

    Hosted search page setting data source values

    Always specify custom Search Hub values in your search interfaces (see Understanding the Search Hub).

You can now browse your new hosted search page item in the Experience Editor or in Preview mode. If your Coveo Platform search page does not appear, see Required API Key Privileges.

Required API Key Privileges

Within Sitecore, calls to the Coveo Platform are performed to get the list of your organization search pages and to fetch the code of the selected search page.

  • In your Coveo organization, for the Configuration API key, the Edit access right on the Search pages domain is required for the Search Page data source Droplist to be populated.

    Configuration API required privileges

  • In your Coveo organization, for the Search API key, the Edit access right on the Search pages domain is required for the Coveo Platform search page code to be retrieved.

    Search API key required rights

Editing a Coveo Platform Search Page Versus Creating Search Pages in Sitecore Items

Using the Example Hosted Search Page branch template is a quick way to integrate a Coveo organization search page into a Sitecore item layout. To further enhance your search page, you must continue to use the Coveo Platform search page editor and leverage the Coveo JavaScript Search Framework directly.

The alternative method is to create search pages from the ground up in Sitecore, using Coveo for Sitecore renderings. This approach lets you use

  • most Coveo JavaScript Search Framework components (and most of their options) indirectly, through the Coveo for Sitecore Hive Framework layer.

  • Sitecore-specific renderings included in the Coveo for Sitecore Hive Framework.

Coveo developers added most Sitecore-specific renderings to take advantage of Sitecore features and context information. These renderings can significantly increase the functionality of search pages and the relevance of search page results.

For instance, the renderings in the Scopes section of the Coveo Hive Renderings Reference Documentation provide useful filtering and boosting functionalities. With a Coveo organization search page, you can achieve similar results by setting up query pipelines (see Manage Query Pipelines).

Recommended Articles