To vote or comment, enter your email and we'll send a magic link


Accordion behaviour for hierarchical checkbox facet


It would be nice if hierarchical checkbox facets would behave like an accordion instead of a toggle for each item separately. Now, if you click on a parent item, the children open. Then if you click on another parent item also those children open too. The list can get very long and it requires the user to make multiple clicks to contract all child lists again.

It would be nice if a click to expand, contracts all the others.

Maybe this behaviour could be optional.

2 years ago

Comments (5)

@remco Did you ever get anything like this to work?

2 years ago

@zackpyle Yes I did, with some custom coding. Here is a gif:


2 years ago

@remco Cool. Mind sharing and save me some time writing it myself?

2 years ago

Hi Zack, I see you also contacted support.

I extracted this code from my site: https://snippi.com/s/i5t81z7

The "contracted" class that is toggled is for the CSS of the plus and minus signs in above gif.

Not sure if this is a full working example, did not test it, but I hope it gets you on the way.

2 years ago

Code snippet to create accordion-style hierarchical Checkboxes facet was added here: https://facetwp.com/help-center/facets/facet-types/checkboxes/#toggle-hierarchical-checkbox-levels-in-accordion-style

6 months ago