When using the "expand hierarchies" option on facet blocks, the list can become a bit unwieldy. It would be nice if the hierarchies were collapsed by default and expanded on hover or by clicking an expand (+ ?) button next to the item.

CommentFileSizeAuthor
#6 i1325462-6.patch6.31 KBattiks
#5 i1325462-5.patch6.21 KBattiks

Comments

attiks’s picture

Also remember the state using a cookie

attiks’s picture

Patch by Jelle_S and some small fixes of me:
you get a new setting at configure facet display called 'Collapsible children'
if checked the hierarchy is collapsible/expandable
the state is recorded inside a cookie
it respects the expand setting ("If checked, this facet will automatically expand if it is the first on the page.")

Tested on Chrome and FF

attiks’s picture

Status: Active » Needs review
Shadlington’s picture

You didn't actually attach a patch

attiks’s picture

StatusFileSize
new6.21 KB

oops

attiks’s picture

StatusFileSize
new6.31 KB

New patch: expanded the block as well if needed

attiks’s picture

I created a new sandbox to keep track of the changes: http://drupal.org/sandbox/attiks/1530898

dargente’s picture

Category: feature » support

The patch doesn't seem to match the latest code from the Collapsible Facets module. Can you provide an update to either the patch or latest Collapsible Facets module? Collapsible Parents is definitely a great feature. Thanks.

jelle_s’s picture

what makes you think that? won't the patch apply? The latest commit to Collapsible facets was Dec 16th 2011, patch was made April 13th 2012

dargente’s picture

Reason I say that is because looking at the patch and the Collapsible Facet module I downloaded, the code is different. Can you guide me in the right direction?

I downloaded the module from here:
git clone http://git.drupal.org/sandbox/katbailey/1229060.git collapsible_facets

jelle_s’s picture

after you've done the git clone command, download the patch and place it in the folder,
then in the terminal, go to that folder and execute this command:

git apply i1325462-6.patch

The patch should then just apply.

attiks’s picture

@dargente you can also download the module from http://drupal.org/sandbox/attiks/1530898, it includes the patch from #6

dargente’s picture

This worked, although I had to copy over the 5 files manually. Not sure if I missed a step. Anyways, all the child taxonomy terms collapse into the parent term as expected. Great module. Thanks!