Sha256: 109080fdb9cfe7eabca12eba42d4699909d3568ef7f13b14513e260928deb6a9

Contents?: true

Size: 1.71 KB

Versions: 61

Compression:

Stored size: 1.71 KB

Contents

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

  tracking_id ||= false
  tracking_category ||= "stepNavHeaderClicked"
  tracking_action ||= "top"
  tracking_label ||= path
  tracking_dimension_enabled = tracking_dimension_enabled != false
  tracking_dimension ||= title
  tracking_dimension_index ||= 29

  if tracking_id
    tracking_options ||= ({ dimension96: tracking_id }).to_json
  end

  local_assigns[:margin_bottom] ||= 0
  shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
  classes = "gem-c-step-nav-header #{shared_helper.get_margin_bottom}"
%>
<% if title %>
  <script type="application/ld+json">
    <%= raw JSON.pretty_generate(breadcrumb_presenter.structured_data) %>
  </script>

  <h2 class="<%= classes %>" data-module="gem-track-click">
    <span class="gem-c-step-nav-header__part-of">Part of</span>
    <% if path %>
      <a href="<%= path %>"
        class="gem-c-step-nav-header__title govuk-link"
        data-track-category="<%= tracking_category %>"
        data-track-action="<%= tracking_action %>"
        data-track-label="<%= tracking_label %>"
        <% if tracking_dimension_enabled %>
          data-track-dimension="<%= tracking_dimension %>"
          data-track-dimension-index="<%= tracking_dimension_index %>"
        <% end %>
        <% if tracking_id %>
          data-track-options='<%= tracking_options %>'
        <% end %>
      >
        <%= title %>
      </a>
    <% else %>
      <span class="gem-c-step-nav-header__title">
        <%= title %>
      </span>
    <% end %>
  </h2>
<% end %>

Version data entries

61 entries across 61 versions & 1 rubygems

Version Path
govuk_publishing_components-24.3.1 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb