Method: SectionRenderer#section_title

Defined in:
app/presentation/section_renderer.rb

#section_titleObject

Display title of the section can come from several places, in order of precedence:

 * 1. (DEPRECATED) :section_title key in config hash. Prefer i18n instead. 
 * 2. Rails i18n, under key 'umlaut.display_sections.#{section_id}.title'
 * 3. If not given, as a default we use the display_name of the first ServiceTypeValue
      object included in this section's results. 
If still blank after all those lookups, then no section title. Set a section title
to the empty string in i18n to force no section title.


432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
# File 'app/presentation/section_renderer.rb', line 432

def section_title
  section_title = nil

  if @options.has_key? :section_title
    # deprecation warning? Not sure the right way to do that. 
    section_title = @options[:section_title]
  else
    section_title = I18n.t("title", :scope => "umlaut.display_sections.#{self.div_id}", 
      :default => Proc.new {
        # Look up from service_type name if possible as default
        if (service_type_values.length > 0)
          service_type_values.first.display_name_pluralize.titlecase
        else
          ""
        end
    })
  end

  section_title = nil if section_title.blank?
  return section_title
end