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

Inherits:
Base
  • Object
show all
Defined in:
lib/locomotive/liquid/drops/page.rb

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



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


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

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

#childrenObject



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

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

#content_typeObject



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

#depthObject



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

def depth
  @_source.depth
end

#fullpathObject



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

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

#listed?Boolean

Returns:



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

def listed?
  @_source.listed?
end

#parentObject



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

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

#published?Boolean

Returns:



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

def published?
  @_source.published?
end

#redirect?Boolean

Returns:



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

def redirect?
  @_source.redirect?
end

#slugObject



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

Returns:



48
49
50
# File 'lib/locomotive/liquid/drops/page.rb', line 48

def templatized?
  @_source.templatized?
end

#titleObject



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

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