Sha256: 37265c01f8219638729497725da6e584262e4c25d5192f75f5eb56f49a047f8b

Contents?: true

Size: 1.1 KB

Versions: 51

Compression:

Stored size: 1.1 KB

Contents

<%
  breadcrumbs ||= []
  inverse ||= false
  collapse_on_mobile ||= false
  breadcrumb_presenter = GovukPublishingComponents::Presenters::Breadcrumbs.new(breadcrumbs)

  classes = "gem-c-breadcrumbs govuk-breadcrumbs"
  classes << " govuk-breadcrumbs--collapse-on-mobile" if collapse_on_mobile
  classes << " gem-c-breadcrumbs--inverse" if inverse
%>

<script type="application/ld+json">
  <%= raw JSON.pretty_generate(breadcrumb_presenter.structured_data) %>
</script>

<div class="<%= classes %>" data-module="track-click">
  <ol class="govuk-breadcrumbs__list">
    <% breadcrumbs.each_with_index do |crumb, index| %>
      <% breadcrumb = GovukPublishingComponents::Presenters::Breadcrumb.new(crumb, index) %>
        <li class="govuk-breadcrumbs__list-item">
        <% if breadcrumb.is_link? %>
          <%= link_to(
            breadcrumb[:title],
            breadcrumb.path,
            data: breadcrumb.tracking_data(breadcrumbs.length),
            class: "govuk-breadcrumbs__link",
          ) %>
        <% else %>
          <%= breadcrumb[:title] %>
        <% end %>
        </li>
    <% end %>
  </ol>
</div>

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
govuk_publishing_components-24.3.0 app/views/govuk_publishing_components/components/_breadcrumbs.html.erb
govuk_publishing_components-24.2.0 app/views/govuk_publishing_components/components/_breadcrumbs.html.erb
govuk_publishing_components-24.1.1 app/views/govuk_publishing_components/components/_breadcrumbs.html.erb
govuk_publishing_components-24.1.0 app/views/govuk_publishing_components/components/_breadcrumbs.html.erb
govuk_publishing_components-24.0.0 app/views/govuk_publishing_components/components/_breadcrumbs.html.erb
govuk_publishing_components-23.15.0 app/views/govuk_publishing_components/components/_breadcrumbs.html.erb
govuk_publishing_components-23.14.0 app/views/govuk_publishing_components/components/_breadcrumbs.html.erb
govuk_publishing_components-23.13.1 app/views/govuk_publishing_components/components/_breadcrumbs.html.erb
govuk_publishing_components-23.13.0 app/views/govuk_publishing_components/components/_breadcrumbs.html.erb
govuk_publishing_components-23.12.3 app/views/govuk_publishing_components/components/_breadcrumbs.html.erb
govuk_publishing_components-23.12.2 app/views/govuk_publishing_components/components/_breadcrumbs.html.erb
govuk_publishing_components-23.12.1 app/views/govuk_publishing_components/components/_breadcrumbs.html.erb
govuk_publishing_components-23.12.0 app/views/govuk_publishing_components/components/_breadcrumbs.html.erb
govuk_publishing_components-23.11.1 app/views/govuk_publishing_components/components/_breadcrumbs.html.erb
govuk_publishing_components-23.11.0 app/views/govuk_publishing_components/components/_breadcrumbs.html.erb
govuk_publishing_components-23.10.2 app/views/govuk_publishing_components/components/_breadcrumbs.html.erb
govuk_publishing_components-23.10.1 app/views/govuk_publishing_components/components/_breadcrumbs.html.erb
govuk_publishing_components-23.10.0 app/views/govuk_publishing_components/components/_breadcrumbs.html.erb
govuk_publishing_components-23.9.2 app/views/govuk_publishing_components/components/_breadcrumbs.html.erb
govuk_publishing_components-23.9.1 app/views/govuk_publishing_components/components/_breadcrumbs.html.erb