Integrate a Coveo Recommendation component
Integrate a Coveo Recommendation component
The Coveo Recommendation component is a Lightning web component that displays a list of recommended results based on recorded events and the user’s navigation history.
Note
The custom token isn’t yet supported with the Coveo Recommendation component. |
To add a Coveo Recommendation component
-
Access the page where you need to insert the component.
-
In the left sidebar, select the Components tab.
-
Under Custom Components, drag the Coveo Recommendation component to the desired location.
-
In the upper-right corner of the page, click Preview, and then set up the search page.
-
Now that you have your Coveo Recommendation component, you must set a Content Recommendation (CR) model in your Coveo organization. See Deploy Content Recommendations (CR).
Integrate a custom Coveo Recommendation component
You may want to integrate a Coveo Recommendation component that you can customize to your needs.
Important
|
To integrate a custom Coveo Recommendation component
-
Integrate the Coveo Community Search component in your Experience Cloud site.
-
Access the Experience Cloud site in Preview mode.
-
Click , and then select Edit.
-
In the Interface Editor that opens, select the Code View tab.
-
Replace the configuration by the following:
<div class="CoveoRecommendation" data-results-per-page="5" data-hide-if-no-results="true" data-excerpt-length="150" data-enable-history="false" style="margin:0;"> <div class="CoveoAnalytics"></div> <div class="coveo-recommendation-header"> <div class="coveo-recommendation-title" style="padding-left: 15px;">Recommendations</div> </div> <div class="coveo-recommendation-body"> <div class="CoveoResultList" data-layout="list"> <script id="Default" class="result-template" type="text/html" data-layout="list"> <div class="coveo-result-row" style="display: flex; align-items: center;"> <div class="coveo-result-cell" style="margin-left: 10px;margin-right: 10px;height: 30px;"> <div class="CoveoIcon" data-small="true" data-with-label="false"></div> </div> <div class="coveo-result-cell"> <a class="CoveoSalesforceResultLink" data-open-in-sub-tab="true" data-always-open-in-new-window="true"></a> </div> </div> </script> </div> </div> </div>
-
Click Save.
You can now modify the options and styling of the component.