Class: Locomotive::Liquid::Drops::Page
- Inherits:
-
Base
- Object
- Liquid::Drop
- Base
- Locomotive::Liquid::Drops::Page
show all
- Defined in:
- lib/locomotive/liquid/drops/page.rb
Instance Method Summary
collapse
Methods inherited from Base
#id, #initialize, liquify
Instance Method Details
#before_method(meth) ⇒ Object
78
79
80
81
|
# File 'lib/locomotive/liquid/drops/page.rb', line 78
def before_method(meth)
@_source.editable_elements.where(slug: meth).try(:first).try(:content)
end
|
#breadcrumbs ⇒ Object
30
31
32
|
# File 'lib/locomotive/liquid/drops/page.rb', line 30
def breadcrumbs
@breadcrumbs ||= liquify(*@_source.ancestors_and_self)
end
|
#children ⇒ Object
34
35
36
|
# File 'lib/locomotive/liquid/drops/page.rb', line 34
def children
@children ||= liquify(*@_source.children)
end
|
#content_type ⇒ Object
66
67
68
69
70
71
72
|
# File 'lib/locomotive/liquid/drops/page.rb', line 66
def content_type
if @_source.content_type
ContentTypeProxyCollection.new(@_source.content_type)
else
nil
end
end
|
#depth ⇒ Object
42
43
44
|
# File 'lib/locomotive/liquid/drops/page.rb', line 42
def depth
@_source.depth
end
|
#editable_elements ⇒ Object
74
75
76
|
# File 'lib/locomotive/liquid/drops/page.rb', line 74
def editable_elements
@editable_elements_hash ||= build_editable_elements_hash
end
|
#fullpath ⇒ Object
38
39
40
|
# File 'lib/locomotive/liquid/drops/page.rb', line 38
def fullpath
@fullpath ||= @_source.fullpath
end
|
58
59
60
|
# File 'lib/locomotive/liquid/drops/page.rb', line 58
def is_layout?
@_source.is_layout?
end
|
46
47
48
|
# File 'lib/locomotive/liquid/drops/page.rb', line 46
def listed?
@_source.listed?
end
|
#original_slug ⇒ Object
22
23
24
|
# File 'lib/locomotive/liquid/drops/page.rb', line 22
def original_slug
@_source.slug
end
|
#original_title ⇒ Object
18
19
20
|
# File 'lib/locomotive/liquid/drops/page.rb', line 18
def original_title
@_source.title
end
|
#parent ⇒ Object
26
27
28
|
# File 'lib/locomotive/liquid/drops/page.rb', line 26
def parent
@parent ||= @_source.parent.to_liquid
end
|
50
51
52
|
# File 'lib/locomotive/liquid/drops/page.rb', line 50
def published?
@_source.published?
end
|
54
55
56
|
# File 'lib/locomotive/liquid/drops/page.rb', line 54
def redirect?
@_source.redirect?
end
|
#slug ⇒ Object
13
14
15
16
|
# File 'lib/locomotive/liquid/drops/page.rb', line 13
def slug
slug = @_source.templatized? ? @context['entry'].try(:_slug).try(:singularize) : nil
slug || @_source.slug
end
|
#templatized? ⇒ Boolean
62
63
64
|
# File 'lib/locomotive/liquid/drops/page.rb', line 62
def templatized?
@_source.templatized?
end
|
#title ⇒ Object
8
9
10
11
|
# File 'lib/locomotive/liquid/drops/page.rb', line 8
def title
title = @_source.templatized? ? @context['entry'].try(:_label) : nil
title || @_source.title
end
|