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 Attribute Summary
Attributes inherited from Base
#_source
Instance Method Summary
collapse
Methods inherited from Base
#id, #initialize, liquify
Instance Method Details
#before_method(meth) ⇒ Object
48
49
50
|
# File 'lib/locomotive/liquid/drops/page.rb', line 48
def before_method(meth)
self._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(*self._source.ancestors_and_self)
end
|
#children ⇒ Object
24
25
26
|
# File 'lib/locomotive/liquid/drops/page.rb', line 24
def children
@children ||= liquify(*self._source.children)
end
|
#depth ⇒ Object
32
33
34
|
# File 'lib/locomotive/liquid/drops/page.rb', line 32
def depth
self._source.depth
end
|
#fullpath ⇒ Object
28
29
30
|
# File 'lib/locomotive/liquid/drops/page.rb', line 28
def fullpath
@fullpath ||= self._source.fullpath
end
|
36
37
38
|
# File 'lib/locomotive/liquid/drops/page.rb', line 36
def listed?
self._source.listed?
end
|
#parent ⇒ Object
16
17
18
|
# File 'lib/locomotive/liquid/drops/page.rb', line 16
def parent
@parent ||= self._source.parent.to_liquid
end
|
40
41
42
|
# File 'lib/locomotive/liquid/drops/page.rb', line 40
def published?
self._source.published?
end
|
44
45
46
|
# File 'lib/locomotive/liquid/drops/page.rb', line 44
def redirect?
self._source.redirect?
end
|
#slug ⇒ Object
12
13
14
|
# File 'lib/locomotive/liquid/drops/page.rb', line 12
def slug
self._source.templatized? ? @context['entry']._slug.singularize : self._source.slug
end
|
#title ⇒ Object
8
9
10
|
# File 'lib/locomotive/liquid/drops/page.rb', line 8
def title
self._source.templatized? ? @context['entry']._label : self._source.title
end
|