Sha256: 0c98b16b20299baa47706683f8148caa1148a36a4f0fd758f2f8eebb26e89c28

Contents?: true

Size: 1.44 KB

Versions: 18

Compression:

Stored size: 1.44 KB

Contents

# -*- encoding: utf-8 -*-

require 'webgen/content_processor/blocks'

module Webgen
  class Context

    # Provides methods for rendering page blocks.
    module Rendering

      # Render the named block and return the result.
      #
      # call-seq:
      #   context.render_block(block_name)
      #   context.render_block(:name => block_name, :option => value, ...)
      #
      # This method uses the functionality of Webgen::ContentProcessor::Blocks for doing the actual
      # work, so you may also want to look at Webgen::ContentProcessor::Blocks.render_block. You can
      # call this method in two ways:
      #
      # [#render_block(block_name)]
      #   Renders the block named +block_name+ of the next node in the current node chain. This is
      #   the version that most want to use since it is equivalent to the use of '<webgen:block
      #   name="block_name" />'. It is also equivalent to '#render_block(:name => block_name)'.
      #
      # [#render_block(opts_hash)]
      #   This version allows the same level of control over the output as the blocks content
      #   processor. For a list of valid options have a look at the documentation of the
      #   Webgen::ContentProcessor::Blocks.render_block method!
      #
      def render_block(name_or_hash)
        name_or_hash = {:name => name_or_hash} if name_or_hash.kind_of?(String)
        Webgen::ContentProcessor::Blocks.render_block(self, name_or_hash)
      end

    end

  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
webgen-1.7.3 lib/webgen/context/rendering.rb
webgen-1.7.2 lib/webgen/context/rendering.rb
webgen-1.7.1 lib/webgen/context/rendering.rb
webgen-1.7.0 lib/webgen/context/rendering.rb
webgen-1.6.0 lib/webgen/context/rendering.rb
webgen-1.5.2 lib/webgen/context/rendering.rb
webgen-1.5.1 lib/webgen/context/rendering.rb
webgen-1.5.0 lib/webgen/context/rendering.rb
webgen-1.4.1 lib/webgen/context/rendering.rb
webgen-1.4.0 lib/webgen/context/rendering.rb
webgen-1.3.0 lib/webgen/context/rendering.rb
webgen-1.2.1 lib/webgen/context/rendering.rb
webgen-1.2.0 lib/webgen/context/rendering.rb
webgen-1.1.0 lib/webgen/context/rendering.rb
webgen-1.0.0 lib/webgen/context/rendering.rb
webgen-1.0.0.beta3 lib/webgen/context/rendering.rb
webgen-1.0.0.beta2 lib/webgen/context/rendering.rb
webgen-1.0.0.beta1 lib/webgen/context/rendering.rb