Closed (won't fix)
Project:
Faceted Search
Version:
5.x-0.21
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
19 Jul 2007 at 14:16 UTC
Updated:
15 Sep 2013 at 13:56 UTC
Jump to comment: Most recent file
Comments
Comment #1
David Lesieur commentedGlad you like the module! There is currently no setting for hiding the counts, but you may override the theme_faceted_search_ui_category() function in your theme.
Comment #2
David Lesieur commentedComment #3
stennie commentedWe had a similar desire to hide the counts in a flexible fashion.
Patch attached (against current cvs head) to add a faceted_search_count_threshold variable which is the minimum count required for each facet term.
So, if you set this to:
0 => no counts displayed
1 => all counts displayed (since a displayed facet term has at least one match)
# => counts only displayed if greater than this number (eg. 5 => 5 or more matches)
Cheers,
Stephen
Comment #4
David Lesieur commentedInteresting... I think having the option of turning the counts off would be a nice feature. However, I wonder what sort of use case would require having counts sometimes displayed, sometimes not, as proposed here. Consistency helps user interface usability. What about making this option a simple checkbox?
Comment #5
stennie commentedHi David,
The use case for counts was at the request of a client who wants more granular control of the UI as they build up their content.
In particular:
- be able to turn off counts completely while there aren't many results
- only show counts when they reach an "interesting" number (like at least 5 or 10)
- eventually, show all counts (except for 1)
It's more of a marketing case, but the strong preference was to avoid a lot of low single digit counts... and the implementation allows that flexibility.
Also as an aside, when we first started using the faceted search the low counts were often inaccurate (but not predictably so). Eventually figured out this was a bug in the taxonomy_facets_node not updating properly for nodes w/ hierarchical taxonomy until the cron ran (#233707). So that probably helped encourage the "don't show low counts if they might be suspect" .. but still seems like a valid UI preference ;-).
Cheers,
Stephen
Comment #6
David Lesieur commentedI'm still not convinced that many people would need this. Recognized UI design principles call for predictability and consistency. I think this feature, when enabled, would make the interface less predictable to end users.
Also, if we have count errors, then we should strive to fix them. :-)
Thanks anyway for the patch (code is gold) and keep up the good work!
Comment #7
mdekkers commentedThat was our reason as well - hide counts for less then desirable numbers - management told us "we dont want customers to see we dont yet have a lot of content on topic xyz, they will think we are not serious about it, etc." I suspect many commercial outfits would feel that way.
Point about UI consistency is very well taken though.
Comment #8
takinola commentedEasy hack to remove the node count is as follows
Edit file faceted_search_ui.module
Go to function theme_faceted_search_ui_category()
change the line that reads
return '<span class="faceted-search-category">'. $label .'<span class="faceted-search-count"> ('. $category->get_count() .')</span></span>';to
return '<span class="faceted-search-category">'. $label .'<span class="faceted-search-count"> </span></span>';of course, you will have to make this change every time you upgrade the module
Comment #9
David Lesieur commented@takinola: Thanks for the clear solution.
Better yet: Add that code to a
mytheme_faceted_search_ui_category()function in your theme's template.php. That way you won't have to re-integrate the change each time you upgrade Faceted Search.Btw, the code can be simplified further:
return '<span class="faceted-search-category">'. $label .'</span>';Comment #10
BeaPower commentedThis does work for current version because I can't find it...
Comment #11
BeaPower commentedWorked, thanks!
Comment #12
BeaPower commentedWorked, nvm had wrong file!
Comment #13
drupalfan81 commentedGreat! Worked. Thanks! I had this hack in their before and then I just upgraded to the new beta3 version and couldn't remember how I got those annoying node count numbers to disappear. I really don't understand why this has yet to be addressed. I think most websites that are just starting out would like this option disabled until they have enough content on their site. Just looks bad from a marketing perspective to have it shown. but love this module, thanks for all that maintain it and keep updating the code. One of my favorite modules!