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
|
# File 'lib/locomotive/steam/liquid/drops/page.rb', line 32
def breadcrumbs
@breadcrumbs ||= liquify(*repository.ancestors_of(@_source))
end
|
#children ⇒ Object
36
37
38
|
# File 'lib/locomotive/steam/liquid/drops/page.rb', line 36
def children
@children ||= liquify(*repository.children_of(@_source))
end
|
#content_type ⇒ Object
40
41
42
43
44
45
46
47
48
|
# File 'lib/locomotive/steam/liquid/drops/page.rb', line 40
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
50
51
52
|
# File 'lib/locomotive/steam/liquid/drops/page.rb', line 50
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
|