0

I want to have a checkbox list in search api(facet api) display widget. enter image description here links with checkboxes not user friendly when you have many items, but checkbox list is user friendly. I mean dropdown checkbox list. how can i do it?

  • Hello @Hamed, is this related to Search API Views? Or Search API Pages? Or something else? – Stefanos Petrakis Apr 3 '16 at 22:03
  • @StefanosPetrakis I edited my question ;) – Hamed Apr 10 '16 at 21:26
2

What you need to do is:

  • In your search api configuration (screen you attached), select "MultiSelect element".
  • Install an appropriate dropdown widget, the jQuery UI MultiSelect Widget is probably the best option for what you need.
  • Configure the jQuery UI MultiSelect Widget to target your Search API's MultiSelect element:
    1. First, figure out what the id or class of that MultiSelect field is. You can use your browser's "Inspect Element" function to figure that out while viewing the standard Search API Facets on a search page.
    2. Once you have the right class or id, go to the configuration page of the jQuery UI MultiSelect Widget (URL is sth like your.drupal.localhost/admin/config/user-interface/jquery_ui_multiselect_widget) and add it in the "JQuery subselector" text box.

That's it, now you should have a the jQuery MultiSelect Widget rendering your standard Search API Facets MultiSelect field.

Here is a screenshot of the end result (search api block facet rendered as a jQuery UI MultiSelect Widget):

enter image description here

Let me know how this goes!

Appendix A: jQuery UI MultiSelect Widget Configuration

enter image description here

Appendix B: jQuery Update Configuration

enter image description here

  • Thank you for your help. but It didn't work. I do all ways and do anythings for it. I tested all jquery update , from 1.5 to 1.10. I checked all classes and Ids. I used 7.x-1.15 version and dev version of jQuery UI MultiSelect Widget. what is the requirement of this module? what should I do. I think drupal has a bad problem for this case. – Hamed Apr 12 '16 at 16:26
  • Did you properly install the jQuery UI MultiSelect Widget? First of all, check your Status Report to see if you included the javascript library (/admin/reports/status). This is fairly easy to configure, not a Drupal problem, really. Let's try to get this going! :-) I added a screenshot of the end-result in my answer. – Stefanos Petrakis Apr 16 '16 at 20:05
  • I checked Report, no problem. What is your jquery version, jQuery UI MultiSelect Widget Version? Can you add screenshot of your jQuery UI MultiSelect Widget setting in configuration? I want to know about "Id" input in configuration. – Hamed Apr 18 '16 at 21:44
  • Hey @Hamed, I updated my answer above, I am using jQuery 1.10 for that page (via jQuery Update module) – Stefanos Petrakis Apr 19 '16 at 10:56
  • Dear Stefanos Thank you so much . It's working for me ;) – Hamed Apr 19 '16 at 13:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.