A common requirement for search integration and facets might be to display a facet block independent of the search. E.g., display a list of popular taxonomy terms on the front page, linked to the appropriately filtered search page.
The attached patch would make this possible by adding a Views display plugin that allows to create such blocks.
Downsides are that you have to manually configure your other facet blocks to ignore the search started by that block, and that the new "Search API facets block" display will be available for all base tables (since Views seemingly doesn't allow you to specify something else).
The display will only be available if both the Views and the Facets extension modules are enabled.
Comments would be very much appreciated!
Comments
Comment #1
fagoLooks like code for adding db-facets?
Comment #2
drunken monkeyAND for adding a view mode to search pages! Yes …
Hm, I think I'm maybe not that good at making patches with git yet. ^^" (Ah, OK, I forgot "--cached" …) Attached should be the correct patch.
Comment #3
drunken monkeyComment #4
drunken monkeyUpdated patch, to fit current repo code, and with a short README (to be a bit expanded, but I'm in a bit of a hurry).
Comment #5
drunken monkeyAnd this includes really all changes …
Comment #6
drunken monkeyUpdated patch.
+ Complete README.txt, mentioning a short "How to" and a few possible caveats.
+ "More link" now works.
+ Minor other tweaks.
Comment #7
drunken monkeyPrevious patch removes paging.
Comment #8
fagoLooks good to me, however I found one very critical issue:
Missing trailing point!
Feature request: Add a views option to hide facet counts.
Comment #9
drunken monkeyOh, thanks for spotting this! Unimaginable what havoc this might have caused if going unnoticed!
Although I have to admit my comments aren't really up-to-date with the Drupal coding standards, as they seem to be updated every five minutes …
Override the theme function.
Anyways, since this seems to work (and I corrected the critical bug above), I finally committed the patch. (And finally have no more patches lying around in the module, yay!)