Closed MrDys closed 12 years ago
Original reporter: cbeer
jrochkind: Committed. I rewrote the code, didn't use chris's patch, but used the same basic approach. Method names may differ.
I did NOT provide a "facet_partial_name" method like Chris did; it's not needed, you can over-ride the new actual rendering method, #render_facet_limit(solr_field). I realized this approach was sufficient for my use case too, no need for the more complicated "configuration" option I had talked about at our meeting yesterday.
Here is an example of how you might over-ride that method to provide custom behavior for a certain facet:
module CustomFacetBehavior def render_facet_limit(solr_field) if ( solr_field == "my_special_field") render(:partial => "my_special_thing") else super(solr_field) end end end
Dispatch.to_prepare do
CatalogController.send(:helper, CustomFacetBehavior)
end
jronallo: I'm reassigning this one to me. I like the intent of this patch, but was unable to apply it. Chris, could you submit an updated test-passing patch for this? If so, I'll try to apply it again.
cbeer: Re-submitted a patch against 8b0652c00f9642fe90f12ae48d8f30628953ce15; sorry about that.
CODEBASE-220: I'd like to move the Blacklight facet display into a separate partial to allow local customization of the facets list (so implementors could use type-specific facet views as appropriate e.g. a date slider for temporal facets). Step one is to move the current facet display code into a separate partial.
I have done so in http://github.com/cbeer/blacklight/commit/fbec766ea94c9c7de8b94f6c9f32549cf1750f93 and in the attached patch.