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
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/locomotive/steam/liquid/drops/page.rb', line 32
def breadcrumbs
return @breadcrumbs if @breadcrumbs
pages = liquify(*repository.ancestors_of(@_source))
pages.pop
@breadcrumbs = pages + [self]
end
|
#children ⇒ Object
43
44
45
|
# File 'lib/locomotive/steam/liquid/drops/page.rb', line 43
def children
@children ||= liquify(*repository.children_of(@_source))
end
|
#content_type ⇒ Object
47
48
49
50
51
52
53
54
55
|
# File 'lib/locomotive/steam/liquid/drops/page.rb', line 47
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
57
58
59
|
# File 'lib/locomotive/steam/liquid/drops/page.rb', line 57
def editable_elements
@editable_elements_hash ||= build_editable_elements_hash
end
|
#original_slug ⇒ Object
24
25
26
|
# File 'lib/locomotive/steam/liquid/drops/page.rb', line 24
def original_slug
@_source.slug
end
|
#original_title ⇒ Object
20
21
22
|
# File 'lib/locomotive/steam/liquid/drops/page.rb', line 20
def original_title
@_source.title
end
|
#parent ⇒ Object
28
29
30
|
# File 'lib/locomotive/steam/liquid/drops/page.rb', line 28
def parent
@parent ||= repository.parent_of(@_source).to_liquid
end
|
#slug ⇒ Object
15
16
17
18
|
# File 'lib/locomotive/steam/liquid/drops/page.rb', line 15
def slug
slug = @_source.templatized? ? @context['entry'].try(:_slug).try(:singularize) : nil
slug || @_source.slug
end
|
#title ⇒ Object
10
11
12
13
|
# File 'lib/locomotive/steam/liquid/drops/page.rb', line 10
def title
title = @_source.templatized? ? @context['entry'].try(:_label) : nil
title || @_source.title
end
|