Class: Xhive::PagePresenter
- Inherits:
-
BasePresenter
- Object
- BasePresenter
- Xhive::PagePresenter
- Defined in:
- app/presenters/xhive/page_presenter.rb
Instance Attribute Summary
Attributes inherited from BasePresenter
Instance Method Summary collapse
-
#render_content(options = {}) ⇒ Object
Public: renders the page content.
-
#render_title(options = {}) ⇒ Object
Public: renders the page title.
Methods inherited from BasePresenter
Constructor Details
This class inherits a constructor from Xhive::BasePresenter
Instance Method Details
#render_content(options = {}) ⇒ Object
Public: renders the page content.
options - The Hash containing the values to use inside the template.
Returns: the rendered page content.
14 15 16 17 18 19 20 21 |
# File 'app/presenters/xhive/page_presenter.rb', line 14 def render_content(={}) layout = ::Liquid::Template.parse("{{content}}").render({"content" => page.content}) result = ::Liquid::Template.parse(layout).render(optional_data(), :registers => {:controller => controller}).html_safe rescue => e log_error(e) ensure return filter_images_urls(result.to_s) end |
#render_title(options = {}) ⇒ Object
Public: renders the page title.
options - The Hash containing the values to use inside the template.
Returns: the rendered page title.
29 30 31 32 33 34 35 |
# File 'app/presenters/xhive/page_presenter.rb', line 29 def render_title(={}) result = ::Liquid::Template.parse(title).render(optional_data()) rescue => e log_error(e) ensure return result.to_s end |