Skip to content

Commit 90d6eeb

Browse files
Fix for secondary navigation not showing correctly (#120)
* Fix for secondary navigation not showing correctly * Swap for a comment about why we can't conditionally render this
1 parent 71cadab commit 90d6eeb

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

app/views/_templates/layout-app.html

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,14 +149,17 @@
149149
</div>
150150
{% endif %}
151151

152-
{% if pageNavigation %}
153-
<div class="nhsuk-grid-row">
154-
<div class="nhsuk-grid-column-full">
155-
{% block pageNavigation %}
156-
{% endblock pageNavigation %}
157-
</div>
152+
153+
{# This will output excess divs where pageNavigation is not set. I could not find a way to stop this. You can't test for truthiness of the block, nor can you capture the contents with set.
154+
155+
See related issues:
156+
https://github.com/mozilla/nunjucks/issues/135
157+
https://github.com/mozilla/nunjucks/issues/164#issuecomment-3073581360 #}
158+
<div class="nhsuk-grid-row">
159+
<div class="nhsuk-grid-column-full">
160+
{% block pageNavigation %}{% endblock pageNavigation %}
158161
</div>
159-
{% endif %}
162+
</div>
160163

161164
{% if gridColumn != "none" %}
162165
<div class="nhsuk-grid-row">

app/views/_templates/layout-reading.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@
174174
<div class="nhsuk-u-margin-bottom-4"></div>
175175
{% include "reading/secondary-navigation.njk" %}
176176

177-
178177
{% endif %}
179178
{% endblock pageNavigation %}
180179

0 commit comments

Comments
 (0)