Sha256: fc29c87a58d878b5dba2723f43a2e7aa4415a9a7846ce38a5daccd78c8f59ade

Contents?: true

Size: 1.33 KB

Versions: 8

Compression:

Stored size: 1.33 KB

Contents

<%
  add_gem_component_stylesheet("step-by-step-nav-header")

  title ||= false
  path ||= false
  disable_ga4 ||= false
  breadcrumbs = [
    { title: "Home", url: "/" },
    { title: title, url: path }
  ]
  breadcrumb_presenter = GovukPublishingComponents::Presenters::Breadcrumbs.new(breadcrumbs)

  component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
  component_helper.add_class("gem-c-step-nav-header")

  unless disable_ga4
    component_helper.add_data_attribute({ module: "ga4-link-tracker" })
    ga4_data = {
      event_name: "navigation",
      type: "super breadcrumb",
      index_link: "1",
      index_total: "1",
    }.to_json
  end
%>
<% if title %>
  <script type="application/ld+json">
    <%= raw JSON.pretty_generate(breadcrumb_presenter.structured_data) %>
  </script>

  <%= tag.div(**component_helper.all_attributes) do %>
    <strong class="gem-c-step-nav-header__part-of">Part of</strong>
    <% if path %>
      <a href="<%= path %>"
        class="gem-c-step-nav-header__title govuk-link gem-c-force-print-link-styles"
        <% unless disable_ga4 %>
          data-ga4-link='<%= ga4_data %>'
        <% end %>
      >
        <%= title %>
      </a>
    <% else %>
      <span class="gem-c-step-nav-header__title">
        <%= title %>
      </span>
    <% end %>
  <% end %>
<% end %>

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
govuk_publishing_components-51.1.0 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-51.0.0 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-50.0.1 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-50.0.0 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-49.1.0 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-49.0.0 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-48.0.0 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-47.0.0 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb