Skip to content

Commit 55d4ba7

Browse files
Merge branch 'main' into check-branches
2 parents 75ade08 + da69941 commit 55d4ba7

File tree

10 files changed

+80
-19
lines changed

10 files changed

+80
-19
lines changed

CHANGELOG.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,66 @@
11
# NHS.UK frontend Changelog
22

3+
## Unreleased
4+
5+
:boom: **Breaking changes**
6+
7+
You must make the following changes when you migrate to this release, or your service might break.
8+
9+
#### Rename component `HTML` param to `html`
10+
11+
If you're using the `card`, `details`, `insetText` or `warningCallout` Nunjucks macros, you need to rename the `HTML` param to `html`.
12+
13+
Before:
14+
15+
```njk
16+
{{ insetText({
17+
HTML: "<p>You'll need to stay away from school, nursery or work until all the spots have crusted over. This is usually 5 days after the spots first appeared.</p>"
18+
}) }}
19+
```
20+
21+
After:
22+
23+
```njk
24+
{{ insetText({
25+
html: "<p>You'll need to stay away from school, nursery or work until all the spots have crusted over. This is usually 5 days after the spots first appeared.</p>"
26+
}) }}
27+
```
28+
29+
This change was made in [pull request #1259: Review legacy Nunjucks params](https://github.com/nhsuk/nhsuk-frontend/pull/1259).
30+
31+
#### Rename details component `text` param to `summaryText`
32+
33+
If you're using the `details` Nunjucks macro you need to rename the `text` param to `summaryText`.
34+
35+
Before:
36+
37+
```njk
38+
{{ details({
39+
text: "Where can I find my NHS number?",
40+
html: "<p>An NHS number is a 10 digit number, like 485 777 3456.</p>"
41+
}) }}
42+
```
43+
44+
After:
45+
46+
```njk
47+
{{ details({
48+
summaryText: "Where can I find my NHS number?",
49+
html: "<p>An NHS number is a 10 digit number, like 485 777 3456.</p>"
50+
}) }}
51+
```
52+
53+
This change ensures consistency with other components, where `text` or `html` params are alternatives and cannot be used together. For example, when only text content is necessary:
54+
55+
```njk
56+
{{ details({
57+
summaryText: "Where can I find my NHS number?",
58+
text: "An NHS number is a 10 digit number, like 485 777 3456."
59+
}) }}
60+
```
61+
62+
This change was made in [pull request #1259: Review legacy Nunjucks params](https://github.com/nhsuk/nhsuk-frontend/pull/1259).
63+
364
## 9.6.0 - 20 May 2025
465

566
:new: **New features**

app/components/all.njk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@
311311
}) }}
312312

313313
{% call details({
314-
"text": "Where can I find my NHS number?"
314+
"summaryText": "Where can I find my NHS number?"
315315
}) %}
316316
<p>An NHS number is a 10 digit number, like 485 777 3456.</p>
317317
<p>You can find your NHS number on any document sent to you by the NHS. This may include:</p>
@@ -326,7 +326,7 @@
326326
{% endcall %}
327327

328328
{% call details({
329-
"text": "Opening times",
329+
"summaryText": "Opening times",
330330
"classes": "nhsuk-expander"
331331
}) %}
332332
{{ table({
@@ -402,7 +402,7 @@
402402

403403
<div class="nhsuk-expander-group">
404404
{% call details({
405-
"text": "How to measure your blood glucose levels",
405+
"summaryText": "How to measure your blood glucose levels",
406406
"classes": "nhsuk-expander"
407407
}) %}
408408
<p>Testing your blood at home is quick and easy, although it can be uncomfortable. It does get better.</p>
@@ -416,7 +416,7 @@
416416
{% endcall %}
417417

418418
{% call details({
419-
"text": "When to check your blood glucose level",
419+
"summaryText": "When to check your blood glucose level",
420420
"classes": "nhsuk-expander"
421421
}) %}
422422
<p>Try to check your blood:</p>

app/components/details/expander-group.njk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<div class="nhsuk-grid-column-two-thirds">
88
<div class="nhsuk-expander-group">
99
{% call details({
10-
"text": "How to measure your blood glucose levels",
10+
"summaryText": "How to measure your blood glucose levels",
1111
"classes": "nhsuk-expander"
1212
}) %}
1313
<p>Testing your blood at home is quick and easy, although it can be uncomfortable. It does get better.</p>
@@ -21,7 +21,7 @@
2121
{% endcall %}
2222

2323
{% call details({
24-
"text": "When to check your blood glucose level",
24+
"summaryText": "When to check your blood glucose level",
2525
"classes": "nhsuk-expander"
2626
}) %}
2727
<p>Try to check your blood:</p>

app/components/details/expander.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<div class="nhsuk-grid-row">
88
<div class="nhsuk-grid-column-two-thirds">
99
{% call details({
10-
"text": "Opening times",
10+
"summaryText": "Opening times",
1111
"classes": "nhsuk-expander"
1212
}) %}
1313
{{ table({

app/components/details/index.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<div class="nhsuk-grid-column-two-thirds">
88

99
{% call details({
10-
"text": "Where can I find my NHS number?"
10+
"summaryText": "Where can I find my NHS number?"
1111
}) %}
1212
<p>An NHS number is a 10 digit number, like 485 777 3456.</p>
1313
<p>You can find your NHS number on any document sent to you by the NHS. This may include:</p>

app/components/typography.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@
315315
<p>This is a paragraph using no class. Aliquam pulvinar posuere elementum. Fusce tincidunt interdum mauris non pretium.</p>
316316

317317
{% call details({
318-
"text": "Where can I find my NHS number?"
318+
"summaryText": "Where can I find my NHS number?"
319319
}) %}
320320
<p>An NHS number is a 10 digit number, like 485 777 3456.</p>
321321
<p>You can find your NHS number on any document sent to you by the NHS. This may include:</p>

packages/components/card/template.njk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@
4646
{%- endif %}
4747
{%- if caller or params.descriptionHtml %}
4848
{{ caller() if caller else params.descriptionHtml | safe }}
49-
{%- elif params.HTML %}
50-
{{ params.HTML | safe }}
5149
{%- elif params.description %}
5250
<p class="nhsuk-card__description">{{ params.description | safe }}</p>
5351
{%- else %}

packages/components/details/template.njk

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
{{- nhsukAttributes(params.attributes) }} {{- " open" if params.open }}>
66
<summary class="nhsuk-details__summary">
77
<span class="nhsuk-details__summary-text">
8-
{{ params.text }}
8+
{{ params.summaryHtml | safe | trim | indent(6) if params.summaryHtml else params.summaryText }}
99
</span>
1010
</summary>
1111
<div class="nhsuk-details__text">
12-
{# params.HTML supported for backwards compatibility - see issue #1089 #}
13-
{{- caller() if caller else (params.html or params.HTML) | safe }}
12+
{% if caller or params.html -%}
13+
{{ caller() if caller else params.html | safe | trim | indent(4) }}
14+
{% elif params.text -%}
15+
{{ params.text }}
16+
{% endif %}
1417
</div>
1518
</details>

packages/components/inset-text/template.njk

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
{%- if params.classes %} {{ params.classes }}{% endif %}"
55
{{- nhsukAttributes(params.attributes) }}>
66
<span class="nhsuk-u-visually-hidden">Information: </span>
7-
{# params.HTML supported for backwards compatibility - see issue #950 #}
8-
{% if caller or params.html or params.HTML -%}
9-
{{ caller() if caller else (params.html or params.HTML) | safe | trim | indent(2) }}
7+
{% if caller or params.html -%}
8+
{{ caller() if caller else params.html | safe | trim | indent(2) }}
109
{% elif params.text -%}
1110
<p>{{ params.text }}</p>
1211
{% endif %}

packages/components/warning-callout/template.njk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
</span>
1515
{%- endif %}
1616
</h{{ headingLevel }}>
17-
{% if caller or params.html or params.HTML -%}
18-
{{ caller() if caller else (params.html or params.HTML) | safe }}
17+
{% if caller or params.html -%}
18+
{{ caller() if caller else params.html | safe }}
1919
{% elif params.text -%}
2020
<p>{{ params.text }}</p>
2121
{% endif %}

0 commit comments

Comments
 (0)