Looking at the Google search results page (see attached screenshot), the facets for "Everything", "Images", etc have images next to them. Although this is possible with Facet API, it requires custom coding and hooking into the widget layer which is a PITA for such a simple task. The great part of the Field API in D7 is the ability attach things such as images to items such as taxonomy terms, and there should be an easy way to render this metadata in facet displays. The way that jumps out at me is leveraging Views.
How I see this working is by adding a Contextual Filter that allows you to pull the facet data returned by the search server so you can build your faceted interfaces using a familiar GUI. Each "block" would be a different View and would have the appropriate base table. The site builder would then add a contextual filter pulling from the appropriate facet field.
Comment | File | Size | Author |
---|---|---|---|
#2 | facet-api-attributes.png | 6.79 KB | ebeyrent |
#1 | facet-images.jpg | 131.8 KB | cpliakas |
Comments
Comment #1
cpliakas CreditAttribution: cpliakas commentedForgot to add screenshot.
Comment #2
ebeyrent CreditAttribution: ebeyrent commentedAnother approach would be to do what the Menu Attributes module does, allowing users to set attributes in the interface such as class or id. Facet API could do something similar, so that the images could be set in CSS with sprites or individual background images.
Comment #3
cpliakas CreditAttribution: cpliakas commentedVery interesting approach.
So we are proposing two systems here. One is the widget system that currently exists in Facet API. I think that the approach mentioned in #2 above would be perfect for that, and could definitely solve the image problem without having to leverage Views.
The second system is Views integration, which in addition to something simple could also hook into a charting / graphing modules for Views and do some really interesting displays. That way I could get out of maintaining a "Chart Facets" module :-).
Thanks for the great idea!
Comment #4
ebeyrent CreditAttribution: ebeyrent commentedTotally agreed. It would rock to be able to display a block of taxonomy facets as a bar graph or the like.
Comment #5
klonos...coming from #1220380: Explore the Apache Solr Facet Builder to identify areas of overlap / integration (to which in turn I came from #1220406: Explore possible integration with Facet API)
Comment #6
cpliakas CreditAttribution: cpliakas commentedLowering priority since this could be implemented in a separate contrib, also bumping to a feature request for the same reason.
Comment #7
cpliakas CreditAttribution: cpliakas commentedAdding to the Contrib component, which means that I am looking for this functionality to be added outside of this module in a separate contrib.
Comment #8
SergeyR CreditAttribution: SergeyR commentedAs for facets with images -one possibility is to put image html tag to field value list.
It works with apache solr integration and recently realized at search api too (see link)
http://drupal.org/node/1343642
Comment #9
danielnolde CreditAttribution: danielnolde commentedComment #10
Georgique CreditAttribution: Georgique commentedSubscribe
Comment #11
Georgique CreditAttribution: Georgique commentedIn case of coming here from http://drupal.org/node/1477836, my request is an opportunity to use facetapi facets instead of views exposed filters. I want it because:
1. Values in facets are limited by view result. For example if I had in view result only publications with author A, I want to see in author's filter only this author A.
2. Facets display counts of values.
This features not work in views exposed filters.
Comment #12
iajay CreditAttribution: iajay commentedsubscribe
Comment #13
bago CreditAttribution: bago commentedI landed here from http://drupal.org/node/1274086
Rendering the facets using a view has nothing to do with letting views know about filters applied by facets.
So, if you prefer to keep open a single issue about every kind of task related to "views" at least the subject should reflect this (it currently make it clear this is about rendering the facets using views and not the other kind of integrations).
Comment #14
cpliakas CreditAttribution: cpliakas commentedSome more ideas posted at #1797616: Marry facets and Views exposed filters regarding normalizing the Facet API paths with how Views exposed filter links are constructed.
Comment #15
Mod74 CreditAttribution: Mod74 commentedSo...this rather crucial integration doesn't work because of a disagreement in the way URLs are created and the contrib idea has been abandoned?
Comment #16
NWOM CreditAttribution: NWOM commentedIt would also be extremely beneficial when it comes to performance. Whenever a facet is submitted, on an already loaded view, it refreshes the entire view (with no filters), and then applies the Faceted filter. If both projects were to marry, then applying a filter on an already loaded view would re-load the view with the facet filter already in place. I hope that makes sense.
Comment #17
NWOM CreditAttribution: NWOM commentedMarking as duplicate since the maintainer said that it would need to be handled via a contrib module here:#1797616: Marry facets and Views exposed filters. However thankfully a contrib module is in the works: https://www.drupal.org/project/facetapi_views