Sha256: 5e86e58f9d88d2b12b0e5ec558400250dc4153ba70bd495dbc574f4f3212367c

Contents?: true

Size: 1.85 KB

Versions: 6

Compression:

Stored size: 1.85 KB

Contents

<%
  add_gem_component_stylesheet("contextual-sidebar")

  ga4_tracking ||= false
  request.query_parameters[:ga4_tracking] = ga4_tracking
  navigation = GovukPublishingComponents::Presenters::ContextualNavigation.new(content_item, request)
  shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
%>

<div class="gem-c-contextual-sidebar">
  <% if navigation.content_tagged_to_a_reasonable_number_of_step_by_steps? %>
    <%# Rendering step by step related items because there are a few but not too many of them %>
    <%= render 'govuk_publishing_components/components/step_by_step_nav_related', links: navigation.step_nav_helper.related_links, ga4_tracking: ga4_tracking %>
  <% end %>

  <% if navigation.content_tagged_to_current_step_by_step? %>
    <%# Rendering step by step sidebar because there's 1 step by step list %>
    <%= render 'govuk_publishing_components/components/step_by_step_nav', navigation.step_nav_helper.sidebar %>
  <% else %>
    <%# Rendering related navigation sidebar because no step by step list %>
    <%= render 'govuk_publishing_components/components/related_navigation', content_item: content_item, context: :sidebar, ga4_tracking: ga4_tracking %>
  <% end %>

  <% if navigation.content_tagged_to_other_step_by_steps? %>
    <%# Rendering step by step related items because there are a few but not too many of them %>
    <%= render 'govuk_publishing_components/components/step_by_step_nav_related', {
      pretitle: t("components.contextual_sidebar.pretitle"),
      links: navigation.step_nav_helper.also_part_of_step_nav,
      always_display_as_list: true,
      ga4_tracking: ga4_tracking
    } %>
  <% end %>

  <% if navigation.show_ukraine_cta? %>
    <%= render 'govuk_publishing_components/components/contextual_sidebar/ukraine_cta', content_item: content_item, ga4_tracking: ga4_tracking %>
  <% end %>
</div>

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
govuk_publishing_components-35.3.0 app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb
govuk_publishing_components-35.2.0 app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb
govuk_publishing_components-35.1.1 app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb
govuk_publishing_components-35.1.0 app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb
govuk_publishing_components-35.0.0 app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb
govuk_publishing_components-34.14.0 app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb