class GovukNavigationHelpers::NavigationHelper

Attributes

content_item[R]

Public Class Methods

new(content_item) click to toggle source
# File lib/govuk_navigation_helpers.rb, line 17
def initialize(content_item)
  @content_item = content_item
end

Public Instance Methods

breadcrumbs() click to toggle source

Generate a breadcrumb trail

@return [Hash] Payload for the GOV.UK breadcrumbs component @see govuk-component-guide.herokuapp.com/components/breadcrumbs

taxon_breadcrumbs() click to toggle source

Generate a breadcrumb trail for a taxon, using the taxon_parent link field

@return [Hash] Payload for the GOV.UK breadcrumbs component @see govuk-component-guide.herokuapp.com/components/breadcrumbs

# File lib/govuk_navigation_helpers.rb, line 33
def taxon_breadcrumbs
  TaxonBreadcrumbs.new(content_item).breadcrumbs
end
taxonomy_sidebar() click to toggle source

Generate a payload containing taxon sidebar data. Intended for use with the related items component.

@return [Hash] Payload for the GOV.UK related items component @see govuk-component-guide.herokuapp.com/components/related_items

# File lib/govuk_navigation_helpers.rb, line 42
def taxonomy_sidebar
  TaxonomySidebar.new(content_item).sidebar
end