Sha256: cc9107519b73a22ec6dc42b31e015eacc2a84e2ee0c265bdf11b5a623e570ddc

Contents?: true

Size: 603 Bytes

Versions: 26

Compression:

Stored size: 603 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 }

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

      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
locomotivecms-3.4.1 app/models/locomotive/concerns/content_type/public_submission_title_template.rb
locomotivecms-4.0.0.alpha2 app/models/locomotive/concerns/content_type/public_submission_title_template.rb
locomotivecms-4.0.0.alpha1 app/models/locomotive/concerns/content_type/public_submission_title_template.rb
locomotivecms-3.4.0 app/models/locomotive/concerns/content_type/public_submission_title_template.rb
locomotivecms-3.3.0 app/models/locomotive/concerns/content_type/public_submission_title_template.rb
locomotivecms-3.3.0.rc3 app/models/locomotive/concerns/content_type/public_submission_title_template.rb
locomotivecms-3.3.0.rc2 app/models/locomotive/concerns/content_type/public_submission_title_template.rb
locomotivecms-3.1.2 app/models/locomotive/concerns/content_type/public_submission_title_template.rb
locomotivecms-3.2.1 app/models/locomotive/concerns/content_type/public_submission_title_template.rb
locomotivecms-3.3.0.rc1 app/models/locomotive/concerns/content_type/public_submission_title_template.rb
locomotivecms-3.2.0 app/models/locomotive/concerns/content_type/public_submission_title_template.rb
locomotivecms-3.2.0.rc2 app/models/locomotive/concerns/content_type/public_submission_title_template.rb
locomotivecms-3.2.0.rc1 app/models/locomotive/concerns/content_type/public_submission_title_template.rb
locomotivecms-3.1.1 app/models/locomotive/concerns/content_type/public_submission_title_template.rb
locomotivecms-3.1.0 app/models/locomotive/concerns/content_type/public_submission_title_template.rb
locomotivecms-3.1.0.rc3 app/models/locomotive/concerns/content_type/public_submission_title_template.rb
locomotivecms-3.1.0.rc2 app/models/locomotive/concerns/content_type/public_submission_title_template.rb
locomotivecms-3.1.0.rc1 app/models/locomotive/concerns/content_type/public_submission_title_template.rb
locomotivecms-3.0.1 app/models/locomotive/concerns/content_type/public_submission_title_template.rb
locomotivecms-3.0.0 app/models/locomotive/concerns/content_type/public_submission_title_template.rb