Sha256: 48ef2e73489af2ecfa9274f8bbca0925cb8db63fbb8a43ddfad0d073ddfe1f4d

Contents?: true

Size: 642 Bytes

Versions: 7

Compression:

Stored size: 642 Bytes

Contents

# We can over-ride a default Blacklight template helper and still call
# super on it, by inserting this module as a helper into CatalogController.
# This plugins setup will do that. 
module BlacklightCql::TemplateHelperExtension

  # Make sure the CQL pseudo-search_field is included in the 'select'
  # when we're displaying a CQL search, so the select makes sense. 
  def search_fields
    field = BlacklightCql::SolrHelperExtension.pseudo_search_field
    
    if params[:q].blank? || params[:search_field] != field[:key]
      super
    else      
      super.clone.push([field[:display_label], field[:key]]).uniq
    end
  end
  
  
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
blacklight_cql-1.0.1 lib/blacklight_cql/template_helper_extension.rb
blacklight_cql-1.0.0 lib/blacklight_cql/template_helper_extension.rb
blacklight_cql-1.0.0pre3 lib/blacklight_cql/template_helper_extension.rb
blacklight_cql-0.9.1 lib/blacklight_cql/template_helper_extension.rb
blacklight_cql-1.0.0pre2 lib/blacklight_cql/template_helper_extension.rb
blacklight_cql-1.0.0pre1 lib/blacklight_cql/template_helper_extension.rb
blacklight_cql-0.9.0 lib/blacklight_cql/template_helper_extension.rb