It looks like the fieldset realm was not yet updated to Drupal 7? There is no form_alter or other code, and the widget is missing.

#12 faceted_forms.tgz6.25 KBphenaproxima
#1 1132744-1.patch709 bytespwolanin


new709 bytes

For now commenting out that realm to avoid user confusion.

Assigned:Unassigned» cpliakas

Assigning to myself for re-integration. Will create a feature branch for this task.

Priority:Normal» Major

This task is dependent on the issue posted at #1176814: Re-implement the widget requirements system.

The google date-range widget is pretty close to the non-JS fallback I started implementing for a general range filter here:

One might even imagine a slider for limiting e.g. at most X days ago

In any case, replication the google format of the date wiget ought to be pretty easy, and that's potentially something that could be used in the fieldset/form pre-search as well as after a search. On thing google doesn't have there which would be cool is to do facet queries and actually show the # of results in each of the options.

Sounds good. Posting comment over to #830654: Implement a date widget for custom date ranges, because I think the date range topic is more relevant to that thread.

Webchick says jump, I say "how high?".

Priority:Major» Normal

I am moving this out of being a D7 stable release blocker. I'm not sure how useful this is anyways, and it could be implemented as a contrib anyways.

Forgot to remove tag.

Component:Code» Contrib

Adding to the Contrib component, which means that I am looking for this functionality to be added outside of this module in a separate contrib.

Category:task» feature

Changing to a feature request.

new6.25 KB


I'm not sure if this is the right place to contribute this, but I needed to create this module for a client - it creates a "Form" realm for Facet API (which is a killer module, by the way). This realm integrates with apachesolr_search and presents the facets for any Solr search page as a single, unified form, which can be retrieved by something like:

drupal_get_form('faceted_forms_page', $search_page_object);

The module provides a single Facet API widget, called "Checkbox(es)", which presents a facet as either a single on/off checkbox (if the facet is boolean), or a set of checkboxes (if it's multiple values). It also exposes a block ("Selected Facets") which will display a list of currently selected facets as they are selected, and allow the user to remove facets by clicking on their names in the list.

You can see the module in action here: I really dig Facet API, and I'm pleased to be able to contribute something back. I hope you find this useful.


Amending #12 - it looks like Facet API does not actually support widget ordering, which is weird because the Form realm I implemented in my proof-of-concept module above allows sorting (which is an option when defining a new facet realm). To fix, edit facetapi/plugins/facetapi/ Change the code at line 1298 from this:

    if (!$build[$this['field alias']]) {
      unset($build[$this['field alias']]);

to this:

    if ($build[$this['field alias']]) {
      if ($realm['sortable']) {
        $build['#weight'] = $settings->settings['weight'];
    else {
      unset($build[$this['field alias']]);

...and voila! Sorting works.


This is extremely useful. I am trying to adapt your example code to searchapi, yours has dependency on apache solr. Do you have any new/updated code? Is there any chance you could help me make this more backend agnostic?

Unfortunately I have not had cause to update it yet - I originally wrote it for use on a client's site, and they were using apachesolr instead of Search API. I have recently fallen head-over-heels in love with Search API, though, and prefer it greatly over apachesolr. So there is a good chance that, should I need to employ my module again, I'll adapt it to work with Search API. I'll certainly post the results here when/if I do.

In the meantime, I don't really know Facet API's internals all that well -- the dependence on apachesolr was really just a result of flailing. So I'd be interested to see what you come up with in terms of adapting my code for other backends! :)

It's all right, I think I have a working prototype half way there with help of you, facetapi code and, will share. Anyone else interested in this issue?

Yes. I am interested in this and can help in testing it.