Class: Www::SupportArticlePresenter
- Inherits:
-
BasePresenter
- Object
- BasePresenter
- Www::SupportArticlePresenter
- Defined in:
- app/presenters/www/support_article_presenter.rb
Overview
Presenter: support article presenter.
Instance Method Summary collapse
-
#breadcrumb(pl: nil) ⇒ ActiveSupport::SafeBuffer
Breadcrumb trail for the support article page.
-
#cache_key ⇒ String
Locale-scoped cache key for the article fragment.
-
#og_image ⇒ nil
Open Graph image for the article (currently unset).
-
#page_description ⇒ String
Meta description for the support article page.
-
#page_title ⇒ String
HTML title for the support article page.
Instance Method Details
#breadcrumb(pl: nil) ⇒ ActiveSupport::SafeBuffer
Breadcrumb trail for the support article page.
35 36 37 38 39 40 41 42 |
# File 'app/presenters/www/support_article_presenter.rb', line 35 def (pl: nil) bcs = [{ name: 'Product Support', url: h.cms_link('/support') }] if (apl = pl || article.product_lines.first) bcs += h.(apl, section: :support) end bcs << { name: article.subject.to_s } h. bcs end |
#cache_key ⇒ String
Locale-scoped cache key for the article fragment.
9 10 11 |
# File 'app/presenters/www/support_article_presenter.rb', line 9 def cache_key "#{I18n.locale}/#{article.cache_key}" end |
#og_image ⇒ nil
Open Graph image for the article (currently unset).
21 22 23 |
# File 'app/presenters/www/support_article_presenter.rb', line 21 def og_image # product_line&.primary_image&.image_url || DEFAULT_SOCIAL_ICON end |
#page_description ⇒ String
Meta description for the support article page.
15 16 17 |
# File 'app/presenters/www/support_article_presenter.rb', line 15 def page_description "Support Article on #{article.description}" end |
#page_title ⇒ String
HTML title for the support article page.
27 28 29 |
# File 'app/presenters/www/support_article_presenter.rb', line 27 def page_title "#{article.page_title} | #{h.company_locale}" end |