Sha256: b88374159e25641005e8ec50b0cd4af6b5de76431fc4583d344e3a7d459299c4

Contents?: true

Size: 1.4 KB

Versions: 14

Compression:

Stored size: 1.4 KB

Contents

module Refinery
  module Pages
    module ContentPagesHelper
      # Build the html for a Refinery CMS page object by creating a ContentPagePresenter. This is a
      # specialised type of ContentPresenter, so the object is then passed to render_content_presenter
      # to get its html. The options are passed to that method, so see render_content_presenter for
      # more details.
      def render_content_page(page, options = {})
        content_page_presenter = Refinery::Pages::ContentPagePresenter.new(page, page_title)
        render_content_presenter(content_page_presenter, options)
      end

      # Pass the options into a ContentPresenter object and return its html. For more
      # details see Refinery::Pages::ContentPresenter (and its subclasses).
      # This method also checks for template overrides. Any template rendered by the
      # current action may specify content_for a section using the section's id. For this
      # reason, sections should not have an ID which you would normally be using for content_for,
      # so avoid common layout names such as :header, :footer, etc.
      def render_content_presenter(content_page, options = {})
        content_page.hide_sections(options[:hide_sections]) if options[:hide_sections]
        content_page.fetch_template_overrides {|section_id| content_for(section_id)}
        content_page.to_html(options[:can_use_fallback])
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
refinerycms-pages-2.1.5 app/helpers/refinery/pages/content_pages_helper.rb
refinerycms-pages-2.1.4 app/helpers/refinery/pages/content_pages_helper.rb
refinerycms-pages-2.1.3 app/helpers/refinery/pages/content_pages_helper.rb
refinerycms-pages-2.1.2 app/helpers/refinery/pages/content_pages_helper.rb
refinerycms-pages-2.1.1 app/helpers/refinery/pages/content_pages_helper.rb
refinerycms-pages-2.1.0 app/helpers/refinery/pages/content_pages_helper.rb
refinerycms-pages-2.0.10 app/helpers/refinery/pages/content_pages_helper.rb
refinerycms-pages-2.0.9 app/helpers/refinery/pages/content_pages_helper.rb
refinerycms-pages-2.0.8 app/helpers/refinery/pages/content_pages_helper.rb
refinerycms-pages-2.0.7 app/helpers/refinery/pages/content_pages_helper.rb
refinerycms-pages-2.0.6 app/helpers/refinery/pages/content_pages_helper.rb
refinerycms-pages-2.0.5 app/helpers/refinery/pages/content_pages_helper.rb
refinerycms-pages-2.0.4 app/helpers/refinery/pages/content_pages_helper.rb
refinerycms-pages-2.0.3 app/helpers/refinery/pages/content_pages_helper.rb