Class: Refinery::Pages::ContentPagePresenter

Inherits:
ContentPresenter show all
Defined in:
pages/app/presenters/refinery/pages/content_page_presenter.rb

Overview

A type of ContentPresenter which specifically knows how to render the html for a Refinery::Page object. Pass the page object into the constructor, and it will build sections from the page’s parts. The page is not retained internally, so if the page changes, you need to rebuild this ContentPagePresenter.

Instance Method Summary collapse

Methods inherited from ContentPresenter

#add_section, #blank_section_css_classes, #fetch_template_overrides, #get_section, #hidden_sections, #hide_sections, #to_html

Constructor Details

#initialize(page, page_title) ⇒ ContentPagePresenter

Returns a new instance of ContentPagePresenter.



8
9
10
11
12
13
# File 'pages/app/presenters/refinery/pages/content_page_presenter.rb', line 8

def initialize(page, page_title)
  super()
  add_default_title_section(page_title) if page_title.present? && Pages.show_title_in_body
  add_page_parts(page.parts) if page
  add_default_post_page_sections
end