Class: Locomotive::Steam::Liquid::Drops::Page
- Inherits:
-
I18nBase
- Object
- Liquid::Drop
- Base
- I18nBase
- Locomotive::Steam::Liquid::Drops::Page
show all
- Defined in:
- lib/locomotive/steam/liquid/drops/page.rb
Instance Method Summary
collapse
Methods inherited from I18nBase
#context=, #initialize
Methods inherited from Base
#as_json, #id, #initialize
Instance Method Details
#breadcrumbs ⇒ Object
34
35
36
37
38
39
40
41
42
43
|
# File 'lib/locomotive/steam/liquid/drops/page.rb', line 34
def breadcrumbs
return @breadcrumbs if @breadcrumbs
pages = liquify(*repository.ancestors_of(@_source))
pages.pop
@breadcrumbs = pages + [self]
end
|
#children ⇒ Object
45
46
47
|
# File 'lib/locomotive/steam/liquid/drops/page.rb', line 45
def children
@children ||= liquify(*repository.children_of(@_source))
end
|
#content_type ⇒ Object
49
50
51
52
53
54
55
56
57
|
# File 'lib/locomotive/steam/liquid/drops/page.rb', line 49
def content_type
if @_source.templatized?
content_type = content_type_repository.find(@_source.content_type_id)
ContentEntryCollection.new(content_type)
else
nil
end
end
|
#editable_elements ⇒ Object
59
60
61
|
# File 'lib/locomotive/steam/liquid/drops/page.rb', line 59
def editable_elements
@editable_elements_hash ||= build_editable_elements_hash
end
|
#original_slug ⇒ Object
26
27
28
|
# File 'lib/locomotive/steam/liquid/drops/page.rb', line 26
def original_slug
@_source.slug
end
|
#original_title ⇒ Object
22
23
24
|
# File 'lib/locomotive/steam/liquid/drops/page.rb', line 22
def original_title
@_source.title
end
|
#parent ⇒ Object
30
31
32
|
# File 'lib/locomotive/steam/liquid/drops/page.rb', line 30
def parent
@parent ||= repository.parent_of(@_source).to_liquid
end
|
#slug ⇒ Object
17
18
19
20
|
# File 'lib/locomotive/steam/liquid/drops/page.rb', line 17
def slug
slug = @_source.templatized? ? @context['entry'].try(:_slug).try(:singularize) : nil
slug || @_source.slug
end
|
#title ⇒ Object
12
13
14
15
|
# File 'lib/locomotive/steam/liquid/drops/page.rb', line 12
def title
title = @_source.templatized? ? @context['entry'].try(:_label) : nil
title || @_source.title
end
|