Skip to content
Snippets Groups Projects

Update src/Plugin/Block/FacetBlock.php

1 file
+ 5
0
Compare changes
  • Side-by-side
  • Inline
@@ -89,6 +89,11 @@ class FacetBlock extends BlockBase implements ContainerFactoryPluginInterface {
// Let the facet_manager build the facets.
$build = $this->facetManager->build($facet);
if ($this->inPreview && in_array('facet-hidden', $build[0]["#attributes"]["class"])) {
// Layout Builder UI will not show facet block with 'facet-hidden'
// attribute unless we return empty array here.
return [];
}
if (!empty($build)) {
CacheableMetadata::createFromObject($this)->applyTo($build);
Loading