Class: Pageflow::InternalLinks::PageLink
- Inherits:
-
Struct
- Object
- Struct
- Pageflow::InternalLinks::PageLink
- Defined in:
- app/helpers/pageflow/internal_links/page_links.rb
Instance Attribute Summary collapse
-
#custom_thumbnail_image_id ⇒ Object
Returns the value of attribute custom_thumbnail_image_id.
-
#optional_description ⇒ Object
Returns the value of attribute optional_description.
-
#page_transition ⇒ Object
Returns the value of attribute page_transition.
-
#position ⇒ Object
Returns the value of attribute position.
-
#target_page ⇒ Object
Returns the value of attribute target_page.
-
#target_page_id ⇒ Object
Returns the value of attribute target_page_id.
-
#template ⇒ Object
Returns the value of attribute template.
Class Method Summary collapse
Instance Method Summary collapse
- #css_class ⇒ Object
- #data_attributes ⇒ Object
- #description ⇒ Object
- #thumbnail_file ⇒ Object
- #title ⇒ Object
Instance Attribute Details
#custom_thumbnail_image_id ⇒ Object
Returns the value of attribute custom_thumbnail_image_id
48 49 50 |
# File 'app/helpers/pageflow/internal_links/page_links.rb', line 48 def custom_thumbnail_image_id @custom_thumbnail_image_id end |
#optional_description ⇒ Object
Returns the value of attribute optional_description
48 49 50 |
# File 'app/helpers/pageflow/internal_links/page_links.rb', line 48 def optional_description @optional_description end |
#page_transition ⇒ Object
Returns the value of attribute page_transition
48 49 50 |
# File 'app/helpers/pageflow/internal_links/page_links.rb', line 48 def page_transition @page_transition end |
#position ⇒ Object
Returns the value of attribute position
48 49 50 |
# File 'app/helpers/pageflow/internal_links/page_links.rb', line 48 def position @position end |
#target_page ⇒ Object
Returns the value of attribute target_page.
55 56 57 |
# File 'app/helpers/pageflow/internal_links/page_links.rb', line 55 def target_page @target_page end |
#target_page_id ⇒ Object
Returns the value of attribute target_page_id
48 49 50 |
# File 'app/helpers/pageflow/internal_links/page_links.rb', line 48 def target_page_id @target_page_id end |
#template ⇒ Object
Returns the value of attribute template
48 49 50 |
# File 'app/helpers/pageflow/internal_links/page_links.rb', line 48 def template @template end |
Class Method Details
.null ⇒ Object
85 86 87 |
# File 'app/helpers/pageflow/internal_links/page_links.rb', line 85 def self.null new(nil, nil, nil, nil) end |
Instance Method Details
#css_class ⇒ Object
70 71 72 73 74 75 76 |
# File 'app/helpers/pageflow/internal_links/page_links.rb', line 70 def css_class [ 'page_link', custom_thumbnail_file ? 'custom_thumbnail' : 'no_custom_thumbnail', optional_description.present? ? 'own_description' : 'no_own_description' ].compact.join(' ') end |
#data_attributes ⇒ Object
78 79 80 81 82 83 |
# File 'app/helpers/pageflow/internal_links/page_links.rb', line 78 def data_attributes {}.tap do |result| result[:page] = target_page.perma_id if target_page result[:page_transition] = page_transition if page_transition.present? end end |
#description ⇒ Object
61 62 63 |
# File 'app/helpers/pageflow/internal_links/page_links.rb', line 61 def description optional_description.presence || target_page_description end |
#thumbnail_file ⇒ Object
65 66 67 68 |
# File 'app/helpers/pageflow/internal_links/page_links.rb', line 65 def thumbnail_file custom_thumbnail_file || (target_page && template.page_thumbnail_file(target_page)) end |
#title ⇒ Object
57 58 59 |
# File 'app/helpers/pageflow/internal_links/page_links.rb', line 57 def title target_page ? target_page.configuration['title'] : '' end |