Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I have a case where I want to show the facet only when one item of that facet is selected.
I select the item from a self constructed link.
Why?
Because this facet has thousands of items, and I only want to show it when one is selected, so you can unselect an item.
I see this is easily done when removing the line in dependency_facet.inc:
unset($enabled_facets[$this->facet['name']]);
Maybe it is some edge-case but I don't think it hurts to make this possible for everyone.
Cheers!
Tom
Comments
Comment #1
ptmkenny CreditAttribution: ptmkenny commentedIf you are using something like FacetAPI Pretty Paths, you can simply hide the facet block on all pages except the relevant facet's path.
This will not disable the facet in the same way that making it a dependency would, but according to your comment you don't need to secure the fact, you just don't want to display it because it has a lot of options.