Module: CommonwealthVlrEngine::BlacklightHelper

Includes:
Blacklight::BlacklightHelperBehavior
Defined in:
app/helpers/commonwealth_vlr_engine/blacklight_helper.rb

Instance Method Summary collapse

Instance Method Details

#document_heading(document = nil) ⇒ Object

local override to allow using CommonwealthVlrEngine::CatalogHelper#render_main_title for catalog#show title heading



7
8
9
10
11
12
13
14
# File 'app/helpers/commonwealth_vlr_engine/blacklight_helper.rb', line 7

def document_heading document=nil
  document ||= @document
  if document[blacklight_config.index.title_field.to_sym]
    render_main_title(document)
  else
    @document.id
  end
end

#render_document_heading(*args) ⇒ Object

local override to use custom #document_heading method (above) for catalog#show title heading



17
18
19
20
21
22
23
24
# File 'app/helpers/commonwealth_vlr_engine/blacklight_helper.rb', line 17

def render_document_heading(*args)
  options = args.extract_options!
  document = args.first
  tag = options.fetch(:tag, :h4)
  document = document || @document

  (tag, document_heading(document), itemprop: "name")
end