Module: UzuUzu::Helper::Page

Defined in:
lib/uzuuzu-cms/helper/page.rb

Instance Method Summary collapse

Instance Method Details



54
55
56
57
58
# File 'lib/uzuuzu-cms/helper/page.rb', line 54

def breadcrumbs(sep)
  page.breadcrumbs.map do |breadcrumb|
    ""
  end.join("#{sep}\n")
end

#contents(options = {}, locals = {}) ⇒ Object



10
11
12
# File 'lib/uzuuzu-cms/helper/page.rb', line 10

def contents(options={}, locals={})
  @_contents ||= page.contents_render(options, locals)
end

#pageObject



6
7
8
# File 'lib/uzuuzu-cms/helper/page.rb', line 6

def page
  @_page ||= controller.info
end

#page_cssObject



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_jsObject



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_metaObject



32
33
34
35
36
37
38
39
40
# File 'lib/uzuuzu-cms/helper/page.rb', line 32

def page_meta
  if page.respond_to?(:page_metas)
    page.page_metas.map do |meta|
      meta(meta.name, meta.content)
    end.join("\n")
  else
    meta("title", page_title)
  end
end

#page_titleObject



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, options={}, locals={})
  @_page = page
  @_contents = contents
  body = page.render(options, 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