Skip to content

Commit d31e0df

Browse files
authored
Adding class params (#143)
* Adding class parameters to the image and inset text components * Removing excess margin from inset text components
1 parent 493eaf3 commit d31e0df

File tree

5 files changed

+18
-11
lines changed

5 files changed

+18
-11
lines changed

docs/_includes/components/image-with-caption.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<figure class="nhsuk-image-with-caption {{ include.class | xml_escape }}">
1+
<figure class="nhsuk-image-with-caption {{ include.classes | xml_escape }}">
22
{% assign src = '/assets/images/' | prepend: site.baseurl | append: include.src %}
33
{% if include.src contains 'https://' %}
44
<img class="nhsuk-image__img" src='{{ include.src | uri_escape }}' alt='{{ include.alt | xml_escape }}' />

docs/_includes/components/image.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<figure class="nhsuk-image {{ include.class | xml_escape }}">
1+
<figure class="nhsuk-image {{ include.classes | xml_escape }}">
22
{% assign src = '/assets/images/' | prepend: site.baseurl | append: include.src %}
33
{% if include.src contains 'https://' %}
44
<img class="nhsuk-image__img" src='{{ include.src | uri_escape }}' alt='{{ include.alt | xml_escape }}' />
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="nhsuk-inset-text">
1+
<div class="nhsuk-inset-text {{ include.classes | xml_escape }}">
22
<span class="nhsuk-u-visually-hidden">Information:</span>
33
{{ include.text | markdownify }}
44
</div>

docs/pages/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ permalink: /
2222
%}
2323
</div>
2424
<div class="nhsuk-grid-column-one-half">
25-
{% include components/image.html src=site.data.home.heading.image alt=site.data.home.heading.image_alt class="nhsnotify-image" %}
25+
{% include components/image.html src=site.data.home.heading.image alt=site.data.home.heading.image_alt classes="nhsnotify-image" %}
2626
</div>
2727
</div>
2828
</div>
@@ -89,7 +89,7 @@ permalink: /
8989
%}
9090
</div>
9191
<div class="nhsuk-grid-column-one-half">
92-
{% include components/image.html src=site.data.home.find-out-more.image alt=site.data.home.find-out-more.image_alt class="nhsnotify-image" %}
92+
{% include components/image.html src=site.data.home.find-out-more.image alt=site.data.home.find-out-more.image_alt classes="nhsnotify-image" %}
9393
</div>
9494
</div>
9595
</div>

docs/pages/using-nhs-notify/personalisation.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ You can send personalised messages by adding personalisation fields to a single
1717
Use double brackets to add a personalisation field to your template. Do not include spaces in your personalisation fields. For example:
1818

1919
{% include components/inset-text.html
20-
text='`Hello ((fullName)), your NHS Number is ((nhsNumber)). Your appointment is on ((appointmentDate)) at ((gpSurgery)).`'
20+
text='Hello `((fullName))`, your NHS Number is `((nhsNumber))`. Your appointment is on `((appointmentDate))` at `((gpSurgery))`.'
21+
classes='nhsuk-u-margin-top-2'
2122
%}
2223

2324
You can read personalisation instructions while you’re editing a template.
@@ -37,7 +38,8 @@ You can use the following PDS fields:
3738
- date
3839

3940
{% include components/inset-text.html
40-
text='Make sure your personalisation fields match the PDS personalisation fields. This includes using the correct order of upper and lower case letters.'
41+
text='Make sure your personalisation fields match the PDS personalisation fields. This includes using the correct order of upper and lower case letters.'
42+
classes='nhsuk-u-margin-top-2'
4143
%}
4244

4345
## Custom personalisation fields (your data)
@@ -94,7 +96,9 @@ text='
9496

9597
- New Surgery (short)
9698
- The Health Centre, Knaresborough Road (medium)
97-
- Church Avenue and Park Grove Medical Group Surgery (long)'
99+
- Church Avenue and Park Grove Medical Group Surgery (long)
100+
'
101+
classes='nhsuk-u-margin-top-2'
98102
%}
99103

100104
Follow these rules for your example data:
@@ -109,7 +113,8 @@ Follow these rules for your example data:
109113
To add personalised links and URLs, include personalisation fields for both the link text and the URL in your template. For example:
110114

111115
{% include components/inset-text.html
112-
text='`[((link_text))](((link_URL)))`'
116+
text='`[((link_text))](((link_URL)))`'
117+
classes='nhsuk-u-margin-top-2'
113118
%}
114119

115120
### Fields to avoid for custom personalisation
@@ -129,11 +134,13 @@ If you use custom personalisation, do not use the following personalisation fiel
129134
- template
130135

131136
{% include components/inset-text.html
132-
text='Using these fields will cause custom personalisation to fail. This includes any variations, for example, if you add spaces, punctuation, and upper or lower case letters.'
137+
text='Using these fields will cause custom personalisation to fail. This includes any variations, for example, if you add spaces, punctuation, and upper or lower case letters.'
138+
classes='nhsuk-u-margin-top-2'
133139
%}
134140

135141
You can include extra words in your custom personalisation fields to make them different to the fields to avoid. For example, if you wanted to include GP surgery phone number, your personalisation field could be:
136142

137143
{% include components/inset-text.html
138-
text='`((GP_phoneNumber))`'
144+
text='`((GP_phoneNumber))`'
145+
classes='nhsuk-u-margin-top-2'
139146
%}

0 commit comments

Comments
 (0)