Skip to content

Commit

Permalink
Add additional skiplink to bypass glossary nav
Browse files Browse the repository at this point in the history
The normal skiplink skips the top level navigation, but the glossary
page also has its own sidebar inside the main element.

This commit adds a "skip to glossary content" skiplink, so users can
skip this as well.
  • Loading branch information
MatMoore committed Apr 9, 2024
1 parent 8fb8645 commit c6fb65d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion templates/base/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
<script>
document.body.className += ' js-enabled' + ('noModule' in HTMLScriptElement.prototype ? ' govuk-frontend-supported' : '');
</script>
{% block skiplinks %}
<a href="#main-content" class="govuk-skip-link" data-module="govuk-skip-link">Skip to main content</a>

{% endblock %}

{% include "base/navigation.html" %}

<div class="govuk-width-container app-width-container">
Expand Down
7 changes: 6 additions & 1 deletion templates/glossary.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
{% load markdown %}
{% load static %}

{% block skiplinks %}
{{block.super}}
<a href="#glossary-content" class="govuk-skip-link" data-module="govuk-skip-link">Skip to glossary content</a>
{% endblock %}

{% block content %}
<div class="govuk-grid-row">
<div class="govuk-grid-column-one-quarter">
Expand Down Expand Up @@ -32,7 +37,7 @@ <h1 class="govuk-heading-l">Glossary</h1>
{%endfor%}
</ul>
</div>
<div class="govuk-grid-column-three-quarters">
<div class="govuk-grid-column-three-quarters" id="glossary-content">
{% for parent_term in results %}
<div class="term-group">
<h2 class="govuk-heading-l" id="{{ parent_term }}">{{ parent_term.name }}</h2>
Expand Down

0 comments on commit c6fb65d

Please sign in to comment.