Class: Locomotive::Liquid::Drops::Page

Inherits:
Base
  • Object
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

Constructor Details

This class inherits a constructor from Locomotive::Liquid::Drops::Base

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


20
21
22
# File 'lib/locomotive/liquid/drops/page.rb', line 20

def breadcrumbs
  @breadcrumbs ||= liquify(*self._source.ancestors_and_self)
end

#childrenObject



24
25
26
# File 'lib/locomotive/liquid/drops/page.rb', line 24

def children
  @children ||= liquify(*self._source.children)
end

#depthObject



32
33
34
# File 'lib/locomotive/liquid/drops/page.rb', line 32

def depth
  self._source.depth
end

#fullpathObject



28
29
30
# File 'lib/locomotive/liquid/drops/page.rb', line 28

def fullpath
  @fullpath ||= self._source.fullpath
end

#listed?Boolean

Returns:



36
37
38
# File 'lib/locomotive/liquid/drops/page.rb', line 36

def listed?
  self._source.listed?
end

#parentObject



16
17
18
# File 'lib/locomotive/liquid/drops/page.rb', line 16

def parent
  @parent ||= self._source.parent.to_liquid
end

#published?Boolean

Returns:



40
41
42
# File 'lib/locomotive/liquid/drops/page.rb', line 40

def published?
  self._source.published?
end

#redirect?Boolean

Returns:



44
45
46
# File 'lib/locomotive/liquid/drops/page.rb', line 44

def redirect?
  self._source.redirect?
end

#slugObject



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

#titleObject



8
9
10
# File 'lib/locomotive/liquid/drops/page.rb', line 8

def title
  self._source.templatized? ? @context['entry']._label : self._source.title
end