I created a patch, which adds blocks for every facet (these blocks contain only one facet). This is additionally to the guided search block, which contains every activated facet. This feature has to be activated in the faceted search environment in the guided search fieldset.
Having separate blocks is very useful, e.g. I can display a block with my top 10 categories on the front page, which links to the faceted search, which then displays all my activated facets.

Comments

mh86’s picture

StatusFileSize
new4.51 KB

attached a updated patch which fixes the naming of the blocks

David Lesieur’s picture

Status: Needs review » Needs work

This is a very valuable feature, which I had omitted mainly because users will have to re-weight each block in the block administration interface (even though facets are already weighted) when multiple blocks are used on the same pages. However, I think that some people still need this additional flexibility.

There is still some issue with the naming of the blocks. You should use the get_label() method on the filter object rather than access the private _field member, which is only available with CCK facets. To make sure everything works, you could test with other types of facets, like Taxonomy Facets, Content Type Facet and Author Facet.

How multiple blocks are handled in faceted_search_ui_guided_block() is very inefficient. The foreach loop should only be executed when $filter_index is null. When it is not null, you may call $search->get_filter($filter_index) to retrieve the right filter without looping.

Also, please improve the labeling of the new option. There is a typo ("seperate" instead of "separate"), and a misleading term in the description ("category" instead of "facet"). Actually, I'd like to suggest the following changes for improved usability:

  • Move your new option right under "Provide Guided search block".
  • Rename the existing "Provide Guided search block" option as "Provide a full Guided search block". Replace the description with "When enabled, this block shows every enabled facet, whose categories may be selected to start or refine a search. Block visibility settings may define additional conditions for this block to appear."
  • Label your new option "Provide separate Guided search blocks". Replace the description with "When enabled, this option provides an individual block for each of the enabled facets, whose categories may be selected to start or refine a search. Block visibility settings may define additional conditions for those blocks to appear."

One last thing that slightly annoys me is the fact that each block gets the same "Guided search" title, and the same "Click a term to initiate a search." tip. I'm sure that many people will want to use more than a single facet block at a time, but no one will want those elements to be repeated on the page. Any idea on how to avoid this?

asak’s picture

Any news on this?

Cool feature...

student297’s picture

is this patch working?
I am looking for this feature.

mikeytown2’s picture

+1 for 6.x

David Lesieur’s picture

yngvewb’s picture

Cool, I was just looking for this feature, is someone using this?

burlinwall’s picture

+1 for 6.x

xiaoqiang’s picture

Is the patch working for the 6.x? anyone testing on the drupal6 and 6.x version?

jakowski’s picture

David, I found the text "Click a term to initiate a search." on line 1468 and 1486 in four locations in the file entitled 'faceted_search_ui.module', deleted everything within the apostrophes and it went away. Maybe there's a better way to do this, as it will probably re-appear when you update the module, but that's what I did for the time being. It would be cool to be able to change this in an admin section somewhere.

As for the "guided search" title, just put <none> in the title field and it will go away.