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
60
61
62
|
# File 'lib/locomotive/liquid/drops/page.rb', line 60
def before_method(meth)
@_source.editable_elements.where(slug: meth).try(:first).try(:content)
end
|
#breadcrumbs ⇒ Object
20
21
22
|
# File 'lib/locomotive/liquid/drops/page.rb', line 20
def breadcrumbs
@breadcrumbs ||= liquify(*@_source.ancestors_and_self)
end
|
#children ⇒ Object
24
25
26
|
# File 'lib/locomotive/liquid/drops/page.rb', line 24
def children
@children ||= liquify(*@_source.children)
end
|
#content_type ⇒ Object
52
53
54
55
56
57
58
|
# File 'lib/locomotive/liquid/drops/page.rb', line 52
def content_type
if @_source.content_type
ContentTypeProxyCollection.new(@_source.content_type)
else
nil
end
end
|
#depth ⇒ Object
32
33
34
|
# File 'lib/locomotive/liquid/drops/page.rb', line 32
def depth
@_source.depth
end
|
#fullpath ⇒ Object
28
29
30
|
# File 'lib/locomotive/liquid/drops/page.rb', line 28
def fullpath
@fullpath ||= @_source.fullpath
end
|
36
37
38
|
# File 'lib/locomotive/liquid/drops/page.rb', line 36
def listed?
@_source.listed?
end
|
#parent ⇒ Object
16
17
18
|
# File 'lib/locomotive/liquid/drops/page.rb', line 16
def parent
@parent ||= @_source.parent.to_liquid
end
|
40
41
42
|
# File 'lib/locomotive/liquid/drops/page.rb', line 40
def published?
@_source.published?
end
|
44
45
46
|
# File 'lib/locomotive/liquid/drops/page.rb', line 44
def redirect?
@_source.redirect?
end
|
#slug ⇒ Object
12
13
14
|
# File 'lib/locomotive/liquid/drops/page.rb', line 12
def slug
@_source.templatized? ? @context['entry']._slug.singularize : @_source.slug
end
|
#templatized? ⇒ Boolean
48
49
50
|
# File 'lib/locomotive/liquid/drops/page.rb', line 48
def templatized?
@_source.templatized?
end
|
#title ⇒ Object
8
9
10
|
# File 'lib/locomotive/liquid/drops/page.rb', line 8
def title
@_source.templatized? ? @context['entry']._label : @_source.title
end
|