Closed (fixed)
Project:
Facet API
Version:
7.x-1.x-dev
Component:
Usability
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
3 Jul 2012 at 11:26 UTC
Updated:
18 Dec 2014 at 00:40 UTC
Jump to comment: Most recent

Comments
Comment #1
cpliakas commentedHi checker.
Thanks for the post and the details around what you are asking for. There are a couple of ways you can do this.
1) Use the "OR" operator and try to get the patch at #1393928-28: Add a per-facet setting that allows only one item to be active at a time to work. This has the adverse side effect of using facets to widen the results.
2) Implement the "negative facet" pattern by configuring the "Minimum facet count" setting to 0 in the facet's display settings form and add some logic in a theme hook override that deactivates active facets and makes the one selected the only active facet. In template.php of your custom theme, override theme_facetapi_link_inactive() with the following code. Note that only the code under the comment "Add functionality requested in #1669600." has been added.
Note that the
$params = &$variables['options']['query']['f'];is an assumption that you are using the standard url processor plugin. If you are using an alternate url processor plugin such as Facet API Pretty Paths, this hack won't work.Thanks,
Chris
Comment #2
checker commentedThank you for your answer cpliakas! I tested 2) but it does not work. There are none inactive items after i selected one item. But I set "Minimum facet count" to 0. Could this be a problem with search_api_db?
Comment #3
cpliakas commentedchecker,
Facet API can only work with the data provided to it by the backend module, so unfortunately if search_api_db doesn't support facets with counts of 0 then this technique won't work and there is nothing you can do on the Facet API layer. If search_api_db can get the data, then I am confident this technique will work. I would recommend pinging that project to see if it is supported.
Thanks,
Chris
Comment #4
checker commentedThank you again. I switched to solr and now it is working.
Comment #5
cpliakas commentedExcellent! Thanks for posting back.
Chris
Comment #6
yurgon commentedHi,
Why dont work with Database search server ?
Comment #7
cpliakas commentedHi yurgon.
This is probably a better question for the Drupal support forums or a post against the Database Search / Search API Solr issue queue since it doesn't have to do with the topic being discussed.
Thanks,
Chris
Comment #8
yurgon commentedI swith to Solr and steel dont work fo me
Comment #10
angheloko commentedHi,
Suggestion 2 in http://drupal.org/node/1669600#comment-6190924 worked perfectly for me.
Just curious, is there a chance that a similar functionality will be committed? I saw quite a few slightly similar issues/requests (http://drupal.org/node/1446824) and I think that one of the common functionalities that is being looked for at Facet API/Search API integration is how to use it as the site's main source of navigation.
In any case, awesome work! :-)
Comment #11
figureone commentedI've submitted a patch to search_api_db that should make that backend work with this patch.
Comment #12
jamesmorrish commentedI also got this working by switching to Solr.
Comment #13
shaneonabike commentedJust for those having issues I wanted to point out that you need to install FacetAPI Pretty Paths dev as per https://www.drupal.org/node/1393928#comment-7145054 if you are using that module. I couldn't figure out why this wasn't working properly until I found that :/