In a recent project I was working on, we needed to create a custom Coveo for Sitecore facet which looks like a toggle, if you know Coveo for Sitecore Hive OOTB components you probably know that OOTB we don't have such a component, so, we would need to create a custom implementation for such component, if you got excited, keep reading!
Below is a sample HTML of how you can style a checkbox input to look like a toggle component, with simple html and styling you can accomplish the look needed:
Now all what you need to do is to use Coveo for Sitecore JS framework, utilizing Coveo events, such as after initialization event, building query query event, & clear breadcrumb Breadcrum events to achieve the desired state, you can notice below that I'm passing a Yes value to my predefined faceted field.
Hopefully the above help you in your challenge or give you an idea how you can build your own custom Coveo component.
No comments:
Post a Comment