Module: Refinery::Pages::ContentPagesHelper
- Defined in:
- pages/app/helpers/refinery/pages/content_pages_helper.rb
Instance Method Summary collapse
-
#refinery_menu_pages ⇒ Object
Compiles the default menu.
-
#render_content_page(page, options = {}) ⇒ Object
Build the html for a Refinery CMS page object by creating a ContentPagePresenter.
-
#render_content_presenter(content_page, options = {}) ⇒ Object
Pass the options into a ContentPresenter object and return its html.
Instance Method Details
#refinery_menu_pages ⇒ Object
Compiles the default menu.
26 27 28 |
# File 'pages/app/helpers/refinery/pages/content_pages_helper.rb', line 26 def Refinery::Menu.new Refinery::Page. end |
#render_content_page(page, options = {}) ⇒ Object
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.
8 9 10 11 |
# File 'pages/app/helpers/refinery/pages/content_pages_helper.rb', line 8 def render_content_page(page, = {}) content_page_presenter = Refinery::Pages::ContentPagePresenter.new(page, page_title) render_content_presenter(content_page_presenter, ) end |
#render_content_presenter(content_page, options = {}) ⇒ Object
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.
19 20 21 22 23 |
# File 'pages/app/helpers/refinery/pages/content_pages_helper.rb', line 19 def render_content_presenter(content_page, = {}) content_page.hide_sections([:hide_sections]) if [:hide_sections] content_page.fetch_template_overrides { |section_id| content_for(section_id)} content_page.to_html([:can_use_fallback]) end |