/** * {@inheritdoc} */ public function setActiveItems(FacetInterface $facet) { // Set the url alias from the the facet object. $this->urlAlias = $facet->getUrlAlias(); // Get the filter key of the facet. if (isset($this->activeFilters[$this->urlAlias])) { foreach ($this->activeFilters[$this->urlAlias] as $value) { $facet->setActiveItem(trim($value, '"')); } } }
/** * {@inheritdoc} */ protected function buildListItems(ResultInterface $result) { $items = parent::buildListItems($result); $items['#attributes']['data-drupal-facet-item-id'] = $this->facet->getUrlAlias() . '-' . $result->getRawValue(); return $items; }