Sha256: 026fa4175e716ade318b0bcb4e4264b4dc5435e05ca7b71bb01e190626ba7dc0
Contents?: true
Size: 1018 Bytes
Versions: 25
Compression:
Stored size: 1018 Bytes
Contents
# frozen_string_literal: true module Blacklight class MetadataFieldComponent < Blacklight::Component with_collection_parameter :field # @param field [Blacklight::FieldPresenter] # @param layout [Blacklight::MetadataFieldLayoutComponent] alternate layout component to use # @param show [Boolean] are we showing only a single document (vs a list of search results); used for backwards-compatibility def initialize(field:, layout: nil, show: false) @field = field @layout = layout || Blacklight::MetadataFieldLayoutComponent @show = show end # @private def label Deprecation.silence(Blacklight::BlacklightHelperBehavior) do if @show helpers.render_document_show_field_label @field.document, label: @field.label('show'), field: @field.key else helpers.render_index_field_label @field.document, label: @field.label, field: @field.key end end end def render? @field.render_field? end end end
Version data entries
25 entries across 25 versions & 2 rubygems