Set default queries and properties while adding search view
When i add search view in the page as component. I need few queries and properties has to be set by default. Is it possible?
kindly advise on this.
thanks in advance.
When adding a Legacy UI Coveo Search View from the Sitecore Experience Editor, it automatically opens the "Rendering Parameters" editor to edit the rendering itself.
All Coveo for Sitecore UI components also support being configured by data source items instead of rendering parameters.
You could prepare a Content Tree item with the default queries and properties.
What you could do when inserting a new Coveo Search View rendering is:
- Always click OK in the rendering parameters dialog. (This saves the component and replace the `$GenerateNewUniqueId` token by a real unique ID).
- In the Sitecore Content Tree, duplicate/clone the item with the default queries. Change the Unique ID field value for this item to have a different unique ID.
- Select the newly inserted component.
- Click the "More" menu in its floating toolbar.
- Click "Edit component properties".
- In the "Data source" field, click browse.
- Select the newly duplicated/cloned item from the Content Tree.
- Click OK in all the dialogs.
- Save the page.
Your component will now read its parameters from the data source item instead of its rendering parameters.