Created
April 9, 2019 17:00
-
-
Save gminero/e2b86d49d96e5b73353cb9caec3cc9b0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<design:component label="CustomSearch"> | |
<design:attribute name="name" label="Name" /> | |
<design:attribute name="autoInitialize" label="Auto Initialize" /> | |
<design:attribute name="autoInjectBasicQuery" label="Auto Inject Basic Query" /> | |
<design:attribute name="autoInjectBasicOptions" label="Auto Inject Basic Options" /> | |
<design:attribute name="debug" label="Debug" /> | |
<design:attribute name="searchHub" label="Search Hub" /> | |
</design:component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:component implements='forceCommunity:availableForAllPageTypes'> | |
<aura:attribute name="name" type="String" default="communityCoveo" access="global" /> | |
<aura:attribute name="autoInitialize" type="Boolean" default="true" access="global" /> | |
<aura:attribute name="autoInjectBasicQuery" type="Boolean" default="true" access="global" /> | |
<aura:attribute name="debug" type="Boolean" default="false" access="global" /> | |
<aura:attribute name="autoInjectBasicOptions" type="Boolean" default="true" access="global" /> | |
<aura:attribute name="searchHub" type="String" default="" access="global" /> | |
<CoveoV2:Search name="{!v.name}" autoInitialize="{!v.autoInitialize}" | |
autoInjectBasicQuery="{!v.autoInjectBasicQuery}" | |
debug="{!v.debug}" | |
autoInjectBasicOptions="{!v.autoInjectBasicOptions}" | |
searchHub="{!v.searchHub}" | |
customScripts="{!$Resource.YourStaticResource + '/YourStaticResourceFile.js'}"/> | |
</aura:component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*This script assumes you have a CoveoFacet wiwth an id `sourceFilter` */ | |
window.coveoCustomScripts['default'] = function (promise, component) { | |
const root = document.querySelector("#search"); | |
const sourceFacetValueCaption = { | |
"ohclouden" : "Online Help - Cloud", | |
"Confluence - Developers" : "Developers", | |
"Web Scraper - AnswersCloud" : "Answers", | |
"Web - TechBlog" : "Technical Blog", | |
"Web - JsSearchRef" : "JavaScript Search Components" | |
}; | |
Coveo.options(root, { | |
sourceFilter : { | |
valueCaption : sourceFacetValueCaption | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment