Gravatar for bberriz@lifeextension.com

Question by Ben, May 22, 2015 9:21 AM

Coveo for Sitecore Standalone Search on a Search Page

The only example I can find for implementing a standalone search on a search page is here. The CoveoForSitecore.componentsOptions do not include an attribute for externalComponents. How should I implement this?

2 Replies
Gravatar for jflheureux@coveo.com

Answer by Jean-François L'Heureux, May 22, 2015 9:33 AM

In Coveo for Sitecore, even if CoveoForSitecore.componentsOptions.externalComponents is undefined by default, you can instantiate it and add your components to it. We use the Javascript Search Framework for the UI so anything you can do in this framework, you can also do it in Coveo for Sitecore.

if (!CoveoForSitecore.componentsOptions.externalComponents) {
    CoveoForSitecore.componentsOptions.externalComponents = [];
}
CoveoForSitecore.componentsOptions.externalComponents.push('IdOfAnExternalComponent');
Gravatar for bberriz@lifeextension.com

Comment by Ben, May 22, 2015 9:47 AM

Your answers always lead me down the right path. My problem was, I wasn't wrapping my $('#coveosearchbox').coveo('noConflict'); statement into the if (!isOnSearchPage()) {} condition. Thanks for your help.

Gravatar for slangevin@coveo.com

Answer by Simon, May 22, 2015 9:28 AM

For Coveo for Sitecore, we have a dedicated component:

https://developers.coveo.com/display/public/SC201504/Integrating+a+Coveo+Search+Box+in+your+Page+Layout

Hope it helps,
Simon

Ask a question