Closed (won't fix)
Project:
Facet API
Version:
7.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
15 Feb 2015 at 05:23 UTC
Updated:
11 Dec 2015 at 13:21 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
damienmckennaThis is the theory, I need to test it.
Comment #2
damienmckennaVerify that $item['#count'] exists, just to be sure.
Comment #3
damienmckennaIt'd be really nice to be able to hide all facets if there's only one search result, but I suspect it's wishful thinking for now.
Comment #4
damienmckennaDoh! Forgot to actually check for $count > 1.
Comment #5
damienmckennaThis version adds two filters - one to remove the facet if there's only one total count, one to remove the filter if there's only one matching item for this facet.
Comment #6
criscomPatch in #5 works for me. Thanks, Damien!
Comment #7
Scott Robertson commented#5 is working for me as well.
Comment #8
sebastien m. commented#5 is working for me too.
thanks
Comment #9
sebastien m. commentedseems to be not working with 'parent_all' taxonomy facets in case of one parent is selected and contains multiple children.
I think that an element shouldn't be hidden if selected.
Comment #10
brockfanning commentedI can't test this at the moment but it should fix #9.
Comment #11
brockfanning commentedTo follow up, I did get a chance to test #10, and it seems to work fine.
Comment #12
brockfanning commentedOne consequence of filtering out single-item facets is that if a user selects 1 item from a 2-item facet, then that facet will disappear, which prevents the user from de-selecting that facet. (They just have to click the back button.)
That seems undesirable to me, so here is an updated version of the patch to deal with that.
Comment #13
brockfanning commentedI recently noticed that the dev version of facetapi_bonus has this functionality. I'll close this issue since there's an existing solution for the problem.