Hello guys.

I have extended Another Facet Dependency plugin with new feature: Show when another facet does not narrow results
There is simple example how it works.

we have content type "Products" with:
field "product type" with values: batteries and TVs
field "brand" with values: Sony and Duracell
field "Voltage" with values: 3V, 1.5V, 9V

4 nodes: 3 batteries and 1 TV

Each field presented as facet on Catalog page.
facet "Voltage" depends from facet "product type:batteries"
Initially, catalog page shows 2 facet blocks:

Facet "product type"
Batteries (3)
TV (1)
Facet "brand"
Duracell (3)
SONY (1)

When we enable facet "Duracell" we will see next facets:

Facet "product type"
Batteries (3)
Facet "brand"
(-) Remove Duracell

And it will be good that "Voltage" block will appear.
So, when "Show when another facet does not narrow results" is enabled Voltage block is shown.

Patch attached.

There is only one thing that does not works: when this option enabled "Force deactivation for unmet dependency." stops working and it make me sad =(

Comments

d.olaresko’s picture

StatusFileSize
new8.72 KB

Improved a bit.

Example:
your block depends from field_type:batteries or field_type:accumulator

If block with types shows:
batteries(3)
accumulator(2)

and there is 5 results then show depended block too.