Sha256: 943efff3813a9dfe523fef478acefba5d78e8e4db62f70ea9b668a9007849777

Contents?: true

Size: 900 Bytes

Versions: 2

Compression:

Stored size: 900 Bytes

Contents

module Fabulator
  module Radiant
    module Actions
      class PagePart < Fabulator::Action

        namespace Fabulator::RADIANT_NS

        attribute :name, :static => false, :eval => true
        attribute :filter, :static => false, :eval => true

        has_select
        has_actions

        def run(context, autovivify = false)
          content = []
          @context.with(context) do |ctx|
            if self.has_select?
              content = self.select(ctx)
            else
              content = self.run_actions(ctx)
            end
            content = content.collect{ |c| c.to([FAB_NS, 'string'], ctx).value }.join('')
            ctx.get_scoped_info('radiant/page/parts')[self.name(ctx).first.to_s] = {
              :content => content,
              :filter => self.filter(ctx).first.to_s
            }
          end
          []
        end

      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
radiant-fabulator-extension-0.0.10 lib/fabulator/radiant/actions/page_part.rb
radiant-fabulator-extension-0.0.9 lib/fabulator/radiant/actions/page_part.rb