Sha256: 30b4f1548d6a33efeddd428398657b8faf33618dd9319d0f69ee94c7282eecf1

Contents?: true

Size: 1.34 KB

Versions: 16

Compression:

Stored size: 1.34 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)

  data = {}
  data[:module] = "ga4-link-tracker" unless disable_ga4

  unless disable_ga4
    ga4_data = {
      event_name: "navigation",
      type: "super breadcrumb",
      index_link: "1",
      index_total: "1",
    }.to_json
  end

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

  <%= tag.div(class: classes, data: data) 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"
        <% 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

16 entries across 16 versions & 1 rubygems

Version Path
govuk_publishing_components-43.5.0 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-43.4.1 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-43.4.0 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-43.3.0 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-43.2.0 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-43.1.1 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-43.1.0 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-43.0.2 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-43.0.1 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-43.0.0 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-42.1.0 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-42.0.0 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-41.1.2 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-41.1.1 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-41.1.0 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-41.0.0 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb