Hi,

I am using facet api and search api and I am trying to make the facets collapsible through collapsiblock. But even though the selectors are pretty straight forward, I can't do it....

A typical facet is:

<div class="block block-facetapi collapsiblock-processed" id="block-facetapi-nps-zjsjqhpw-iinw21semqkhwrrbfk6">
	<h2>Filters</h2>
	<div class="content">
		<div class="item-list">
			<h3>Search found 5 items</h3>
			<ul>
				<li class="first last">[all items]</li>
			</ul>
		</div>  
	</div>
</div>

And the selectors I use are:
div.block
h2:first
div.content

It should work! Right?

Any help would be very welcome...

P.S. And all other blocks are collapsible.

CommentFileSizeAuthor
#1 array2lower-1301454-1.patch751 bytesmatrixlord

Comments

matrixlord’s picture

StatusFileSize
new751 bytes

Ok, I found the problem.

Facet api uses a combination of upper and lower case letters but when it comes to javascript it is only lower case.
So the script cannot find the divs by id(so it is not working).

The easiest solution is to change line 20 of collapsiblock.module
from:

            'blocks' => variable_get('collapsiblock_settings', array()),

to:

            'blocks' => array_change_key_case(variable_get('collapsiblock_settings', array())),

I am not sure if this is a bug. But I attached a patch anyway.

matrixlord’s picture

Component: User interface » Code
Category: support » bug
Status: Active » Needs review
auraell’s picture

Priority: Normal » Minor
Status: Needs review » Fixed

Thanks for the patch! Works with Apache Solr Search blocks too!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

gagarine’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Status: Closed (fixed) » Reviewed & tested by the community

@auraell never close a bug if it's not committed!

gagarine’s picture

Status: Reviewed & tested by the community » Fixed

now it's commited

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

sergio morais’s picture

Issue summary: View changes

for some reason the patch is not committed anymore

sergio morais’s picture

Status: Closed (fixed) » Patch (to be ported)
gagarine’s picture

Status: Patch (to be ported) » Fixed

It's commited in dev version. I will create a release soon.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.