Module: UzuUzu::Helper::Page
- Defined in:
- lib/uzuuzu-cms/helper/page.rb
Instance Method Summary collapse
- #breadcrumbs(sep) ⇒ Object
- #contents(options = {}, locals = {}) ⇒ Object
- #page ⇒ Object
- #page_css ⇒ Object
- #page_js ⇒ Object
- #page_meta ⇒ Object
- #page_title ⇒ Object
- #render_page(page, contents = nil, options = {}, locals = {}) ⇒ Object
- #render_plugin(page, body) ⇒ Object
Instance Method Details
#breadcrumbs(sep) ⇒ Object
54 55 56 57 58 |
# File 'lib/uzuuzu-cms/helper/page.rb', line 54 def (sep) page..map do || "" end.join("#{sep}\n") end |
#contents(options = {}, locals = {}) ⇒ Object
10 11 12 |
# File 'lib/uzuuzu-cms/helper/page.rb', line 10 def contents(={}, locals={}) @_contents ||= page.contents_render(, locals) end |
#page ⇒ Object
6 7 8 |
# File 'lib/uzuuzu-cms/helper/page.rb', line 6 def page @_page ||= controller.info end |
#page_css ⇒ Object
48 49 50 51 52 |
# File 'lib/uzuuzu-cms/helper/page.rb', line 48 def page_css page.css_urls.map do |url| css(url) end.join("\n") end |
#page_js ⇒ Object
42 43 44 45 46 |
# File 'lib/uzuuzu-cms/helper/page.rb', line 42 def page_js page.js_urls.map do |url| js(url) end.join("\n") end |
#page_meta ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/uzuuzu-cms/helper/page.rb', line 32 def if page.respond_to?(:page_metas) page..map do || (.name, .content) end.join("\n") else ("title", page_title) end end |
#page_title ⇒ Object
28 29 30 |
# File 'lib/uzuuzu-cms/helper/page.rb', line 28 def page_title h page.page_title end |
#render_page(page, contents = nil, options = {}, locals = {}) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/uzuuzu-cms/helper/page.rb', line 14 def render_page(page, contents=nil, ={}, locals={}) @_page = page @_contents = contents body = page.render(, locals) body = render_engine(body) @_page = nil @_contents = nil body end |
#render_plugin(page, body) ⇒ Object
24 25 26 |
# File 'lib/uzuuzu-cms/helper/page.rb', line 24 def render_plugin(page, body) ::UzuUzu::Plugin.render(page, body) end |