Sha256: 5d3876a08f2bc4ff1b7e4f6a2c3bcd22713562593676b5b61ab48f6187b4d6b2

Contents?: true

Size: 657 Bytes

Versions: 11

Compression:

Stored size: 657 Bytes

Contents

module Locomotive
  module Concerns
    module ContentType
      module PublicSubmissionTitleTemplate

        extend ActiveSupport::Concern

        included do
          field :public_submission_title_template
        end

        def public_submission_title(entry, options)
          template = ::Liquid::Template.parse(self.public_submission_title_template, {})

          assigns   = { 'site' => self.site, 'entry' => entry }.merge(options)
          registers = { site: self.site, services: Locomotive::Steam::Services.build_instance }

          template.render(::Liquid::Context.new({}, assigns, registers))
        end

      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
locomotivecms-4.2.0.alpha2 app/models/locomotive/concerns/content_type/public_submission_title_template.rb
locomotivecms-4.2.0.alpha1 app/models/locomotive/concerns/content_type/public_submission_title_template.rb
locomotivecms-4.1.1 app/models/locomotive/concerns/content_type/public_submission_title_template.rb
locomotivecms-4.1.0 app/models/locomotive/concerns/content_type/public_submission_title_template.rb
locomotivecms-4.1.0.rc1 app/models/locomotive/concerns/content_type/public_submission_title_template.rb
locomotivecms-4.0.3 app/models/locomotive/concerns/content_type/public_submission_title_template.rb
locomotivecms-4.0.2 app/models/locomotive/concerns/content_type/public_submission_title_template.rb
locomotivecms-4.0.1 app/models/locomotive/concerns/content_type/public_submission_title_template.rb
locomotivecms-4.0.0 app/models/locomotive/concerns/content_type/public_submission_title_template.rb
locomotivecms-4.0.0.rc0 app/models/locomotive/concerns/content_type/public_submission_title_template.rb
locomotivecms-4.0.0.alpha3 app/models/locomotive/concerns/content_type/public_submission_title_template.rb