Hi frends,
i use

  • apachesolr 7.x-1.1,
  • facetapi 7.x-1.2,
  • facetapi_multiselect 7.x-1.0-beta1

there is two custom facets (Implements in hook_facetapi_facet_info()):
thereis
but i need both in one block (form):
need
Is it possible? How i can resolve this task?
Sorry if this has already been discussed
Thanks,
Max

CommentFileSizeAuthor
Screenshot need.png9.08 KBtheaidem
Screenshot is.png12.19 KBtheaidem
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cpliakas’s picture

Hi drupunk.

I'm not sure if facetapi_multiselect will work with this module, but something like http://drupal.org/sandbox/thegreat/1230568 is what you need. Unfortunately it is a sandbox project, but a lot of work has been done on the Facet API side to ensue that as little code is needed as possible in order to achieve this.

To put this in another way, there is a realm that displays all facets in a single block. You could use this to group your two facets.

Hope this helps,
Chris

theaidem’s picture

Thanks for reply Chris,
Unfortunately is sandbox project (Facet API Block), not solved the problem for me, because i need a single block and single form width two multiselects and one submit button
I tried make this an realm system, but didn't understand how work it.
custom_facet.module

function custom_facet_facetapi_realm_info() {
  $realms = array();

  $realm_info = module_invoke('facetapi', 'facetapi_realm_info');
  $realms['combo'] = array(
    'label' => t('Combo facets'),
    'weight' => -8,
    'default widget' => 'facetapi_multiselect',
    'element type' => 'form elements',
  ) + $realm_info['block'];

  return $realms;
}

function custom_facet_facetapi_facet_info_alter(array &$facet_info, array $searcher_info) {
  $facet_info['im_field_data_meter']['default widget'] = 'combo';
  $facet_info['itm_field_range']['default widget'] = 'combo';
}

function custom_facet_block_info() {
  return facetapi_get_block_info(array('combo'));
}

function custom_facet_block_view($delta = '') {
  return facetapi_block_view($delta);
}

And where my block "Combo facets"? What am I doing wrong?
Thanks,
Max

j4’s picture

Issue summary: View changes

Hi did you get this working? If yes could you please share the code?

Thanks
Jaya

davewilly’s picture

Any update on this? Thanks.

pinkonomy’s picture

I am also interested on this,do we have any news?
thanks

Coyote6GraphX’s picture

@theaidem thanks for posting that info. I know it is 5 years later, but it helped me write a module to do this. For anyone who needs it:
https://github.com/Coyote6/drupal-7-combined-facet-block

NWOM’s picture

@Coyote6GraphX would you mind posting it as a module on drupal.org? Thank you by the way, I'll be sure to check it out.