Skip to content

Commit

Permalink
Add Spotlight::Engine.config.default_browse_index_view_type configura…
Browse files Browse the repository at this point in the history
…tion instead of hard-coding :gallery view for browse categories
  • Loading branch information
cbeer committed Apr 9, 2015
1 parent 530cbca commit 0e36278
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/helpers/spotlight/browse_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ module BrowseHelper
# Override Blacklight's #default_document_index_view_type helper to
# use a different default view when presenting browse categories
def default_document_index_view_type
(:gallery if blacklight_config.view.has_key? :gallery) || super
(default_browse_index_view_type if blacklight_config.view.has_key? default_browse_index_view_type) || super
end

private

def default_browse_index_view_type
Spotlight::Engine.config.default_browse_index_view_type
end
end
end
2 changes: 2 additions & 0 deletions lib/spotlight/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ def self.blacklight_config
facet: false,
'facet.field' => [] }

Spotlight::Engine.config.default_browse_index_view_type = :gallery

# Field containing the last modified date for a Solr document
Blacklight::Configuration.default_values[:index].timestamp_field ||= 'timestamp'

Expand Down

0 comments on commit 0e36278

Please sign in to comment.