Sha256: 2d0d2fde3d8ee0aa5e51f7a54428636b27e7755c2d9dc68d2df07020464e4986

Contents?: true

Size: 1.36 KB

Versions: 19

Compression:

Stored size: 1.36 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 gem-print-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

19 entries across 19 versions & 1 rubygems

Version Path
govuk_publishing_components-45.2.0 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-45.1.0 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-45.0.0 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-44.11.0 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-44.10.0 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-44.9.1 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-44.9.0 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-44.8.0 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-44.7.1 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-44.7.0 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-44.6.0 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-44.5.0 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-44.4.2 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-44.4.1 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-44.4.0 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-44.3.0 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-44.2.0 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-44.1.0 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
govuk_publishing_components-44.0.0 app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb