Module: BlacklightFacetExtras::ViewHelperExtension

Defined in:
lib/blacklight_facet_extras/view_helper_extension.rb

Instance Method Summary collapse

Instance Method Details

#facet_values_for(solr_field) ⇒ Object



10
11
12
# File 'lib/blacklight_facet_extras/view_helper_extension.rb', line 10

def facet_values_for(solr_field)
  @response.facets.detect {|f| f.name == solr_field}
end

#render_facet_value(facet_solr_field, item, options = {}) ⇒ Object



2
3
4
5
6
7
8
# File 'lib/blacklight_facet_extras/view_helper_extension.rb', line 2

def render_facet_value(facet_solr_field, item, options ={})
  if item.respond_to? :display_label
    (link_to_unless(options[:suppress_link], item.display_label || item.value , add_facet_params_and_redirect(facet_solr_field, item.value), :class=>"facet_select label") + " " + render_facet_count(item.hits)).html_safe
  else
    super(facet_solr_field, item, options)
  end
end