Gravatar for wrolloff@gmail.com

Question by Will Rolloff, Apr 18, 2017 6:21 AM

CoveoFacetSlider depends on

Does the Coveo Date Slider Facet (CoveoFacetSlider) support the Depends On functionality? I have tried adding the attribute and it does not appear to work.

1 Reply
Gravatar for slangevin@coveo.com

Answer by Simon, Apr 18, 2017 9:56 AM

Not according to the documentation : https://coveo.github.io/search-ui/components/facetslider.html

Especially since it says: Note that this component does not inherit from the Facet component, and thus does not offer the same configuration options.

So you might want to post it has a desired product feature: https://coveo.ideas.aha.io/

In the short run, I believe you could hide it during the init (Coveo for Sitecore example):

Coveo.$('#@Model.Id')
  .on(Coveo.QueryEvents.newQuery, function(e, args) {
    var facetNotEmpty = {the code you prefer to retrieve from the GroupByResults of your facet to depend on and store is as a boolean}
    if (facetNotEmpty) {
      Coveo.get({the DOM id of the facet}).enable();
    } else {
      Coveo.get({the DOM id of the facet}).disable();
    }
  })
  .coveoForSitecore('init', CoveoForSitecore.componentsOptions);

Cheers,

Simon

Ask a question