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



78
79
80
81
# File 'lib/locomotive/liquid/drops/page.rb', line 78

def before_method(meth)
  # @deprecated
  @_source.editable_elements.where(slug: meth).try(:first).try(:content)
end


30
31
32
# File 'lib/locomotive/liquid/drops/page.rb', line 30

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

#childrenObject



34
35
36
# File 'lib/locomotive/liquid/drops/page.rb', line 34

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

#content_typeObject



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

#depthObject



42
43
44
# File 'lib/locomotive/liquid/drops/page.rb', line 42

def depth
  @_source.depth
end

#editable_elementsObject



74
75
76
# File 'lib/locomotive/liquid/drops/page.rb', line 74

def editable_elements
  @editable_elements_hash ||= build_editable_elements_hash
end

#fullpathObject



38
39
40
# File 'lib/locomotive/liquid/drops/page.rb', line 38

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

#is_layout?Boolean

Returns:



58
59
60
# File 'lib/locomotive/liquid/drops/page.rb', line 58

def is_layout?
  @_source.is_layout?
end

#listed?Boolean

Returns:



46
47
48
# File 'lib/locomotive/liquid/drops/page.rb', line 46

def listed?
  @_source.listed?
end

#original_slugObject



22
23
24
# File 'lib/locomotive/liquid/drops/page.rb', line 22

def original_slug
  @_source.slug
end

#original_titleObject



18
19
20
# File 'lib/locomotive/liquid/drops/page.rb', line 18

def original_title
  @_source.title
end

#parentObject



26
27
28
# File 'lib/locomotive/liquid/drops/page.rb', line 26

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

#published?Boolean

Returns:



50
51
52
# File 'lib/locomotive/liquid/drops/page.rb', line 50

def published?
  @_source.published?
end

#redirect?Boolean

Returns:



54
55
56
# File 'lib/locomotive/liquid/drops/page.rb', line 54

def redirect?
  @_source.redirect?
end

#slugObject



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

Returns:



62
63
64
# File 'lib/locomotive/liquid/drops/page.rb', line 62

def templatized?
  @_source.templatized?
end

#titleObject



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