Skip to content

Commit 2e0965c

Browse files
committed
Organise page template options by element, top to bottom
After moving the component options to headings rather than a table, this spike explores how they might be grouped by element (ish).
1 parent 964f2c5 commit 2e0965c

File tree

1 file changed

+59
-45
lines changed

1 file changed

+59
-45
lines changed

src/styles/page-template/index.md

Lines changed: 59 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,17 @@ To change the components that are included in the page template by default, set
8181
{% endraw %}
8282
```
8383

84-
### Options
84+
### Update the `<html>` element
85+
86+
#### `htmlClasses` (Variable)
87+
88+
Add a class to the `<html>` element.
89+
90+
#### `htmlLang` (Variable)
91+
92+
Set the language of the whole document. If your `<title>` and `<main>` element are in a different language to the rest of the page, use `htmlLang` to set the language of the rest of the page.
93+
94+
### Update the `<head>` element
8595

8696
#### `assetPath` (Variable)
8797

@@ -91,70 +101,74 @@ Specify a path to the <a href="https://frontend.design-system.service.gov.uk/imp
91101

92102
Set the domain for assets where an absolute URL is required, for example the Open Graph image.
93103

94-
#### `beforeContent` (Block)
104+
#### `head` (Block)
95105

96-
Add content that needs to appear outside `<main>` element.
97-
For example: The [Back link component](/components/back-link/), [Breadcrumbs component](/components/breadcrumbs/),
98-
[Phase banner component](/components/phase-banner/).
106+
Add additional items inside the `<head>` element.
107+
For example: `<meta name="description" content="My page description">`
99108

100-
#### `bodyAttributes` (Variable)
109+
#### `headIcons` (Block)
101110

102-
Add attributes to the `<body>` element. Add each attribute and its value in the `bodyAttributes` object.
111+
Override the default icons used for GOV.UK branded pages.
112+
For example: `<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">`
103113

104-
#### `bodyClasses` (Variable)
114+
#### `opengraphImageUrl` (Variable)
105115

106-
Add a class to the `<body>` element.
116+
Set the URL for the Open Graph image meta tag. The URL must be absolute, including the protocol and domain name. If you're using the refreshed GOV.UK brand, you may need to update this path to point to the updated assets.
107117

108-
#### `bodyEnd` (Block)
118+
#### `pageTitle` (Block)
109119

110-
Add content just before the closing `<body>` element.
120+
Override the default page title (`<title>` element).
111121

112-
#### `bodyStart` (Block)
122+
#### `pageTitleLang` (Variable)
113123

114-
Add content after the opening `<body>` element.
115-
For example: The [Cookie banner component](/components/cookie-banner/).
124+
Set the language of the `<title>` element if it's different to `htmlLang`.
116125

117-
#### `containerClasses` (Variable)
126+
#### `themeColor` (Variable)
118127

119-
Add a class to the container. This is useful if you want to make the page wrapper a fixed width.
128+
Set the [toolbar colour on some devices](https://developer.chrome.com/blog/support-for-theme-color-in-chrome-39-for-android).
120129

121-
#### `content` (Block)
130+
### Update the `<body>` element
122131

123-
Add content that needs to appear centered in the `<main>` element.
132+
#### `bodyAttributes` (Variable)
124133

125-
#### `cspNonce` (Variable)
134+
Add attributes to the `<body>` element. Add each attribute and its value in the `bodyAttributes` object.
126135

127-
Add a `nonce` attribute to the script for your Content Security Policy (CSP). Provide a nonce that hostile actors cannot guess, as otherwise they can easily find a way around your CSP. However, you should use this attribute only if you’re not able to [include the hash for the inline scripts in your service’s CSP](https://frontend.design-system.service.gov.uk/import-javascript/#if-our-inline-javascript-snippet-is-blocked-by-a-content-security-policy).
136+
#### `bodyClasses` (Variable)
128137

129-
#### `footer` (Block)
138+
Add a class to the `<body>` element.
130139

131-
Override the default [Footer component](/components/footer/).
140+
#### `bodyEnd` (Block)
132141

133-
#### `govukRebrand` (Variable)
142+
Add content just before the closing `<body>` element.
134143

135-
Enables rebranded styles. If you’ve overridden any blocks that are affected by this, you may have to make manual changes. See the [v5.10.0 release notes](https://github.com/alphagov/govuk-frontend/releases/tag/v5.10.0) for more information.
144+
#### `bodyStart` (Block)
136145

137-
#### `head` (Block)
146+
Add content after the opening `<body>` element.
147+
For example: The [Cookie banner component](/components/cookie-banner/).
138148

139-
Add additional items inside the `<head>` element.
140-
For example: `<meta name="description" content="My page description">`
149+
### Update the page's header
141150

142151
#### `header` (Block)
143152

144153
Override the default [Header component](/components/header/).
145154

146-
#### `headIcons` (Block)
155+
### Update the page's container
147156

148-
Override the default icons used for GOV.UK branded pages.
149-
For example: `<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">`
157+
#### `containerClasses` (Variable)
150158

151-
#### `htmlClasses` (Variable)
159+
Add a class to the container. This is useful if you want to make the page wrapper a fixed width.
152160

153-
Add a class to the `<html>` element.
161+
#### `beforeContent` (Block)
154162

155-
#### `htmlLang` (Variable)
163+
Add content that needs to appear outside `<main>` element.
164+
For example: The [Back link component](/components/back-link/), [Breadcrumbs component](/components/breadcrumbs/),
165+
[Phase banner component](/components/phase-banner/).
156166

157-
Set the language of the whole document. If your `<title>` and `<main>` element are in a different language to the rest of the page, use `htmlLang` to set the language of the rest of the page.
167+
### Update the page's main content
168+
169+
#### `content` (Block)
170+
171+
Add content that needs to appear centered in the `<main>` element.
158172

159173
#### `main` (Block)
160174

@@ -168,26 +182,26 @@ Add a class to the `<main>` element.
168182

169183
Set the language of the `<main>` element if it's different to `htmlLang`
170184

171-
#### `opengraphImageUrl` (Variable)
185+
### Update the page's footer
172186

173-
Set the URL for the Open Graph image meta tag. The URL must be absolute, including the protocol and domain name. If you're using the refreshed GOV.UK brand, you may need to update this path to point to the updated assets.
187+
#### `footer` (Block)
174188

175-
#### `pageTitle` (Block)
189+
Override the default [Footer component](/components/footer/).
176190

177-
Override the default page title (`<title>` element).
191+
### Other options
178192

179-
#### `pageTitleLang` (Variable)
193+
#### `cspNonce` (Variable)
180194

181-
Set the language of the `<title>` element if it's different to `htmlLang`.
195+
Add a `nonce` attribute to the script for your Content Security Policy (CSP). Provide a nonce that hostile actors cannot guess, as otherwise they can easily find a way around your CSP. However, you should use this attribute only if you’re not able to [include the hash for the inline scripts in your service’s CSP](https://frontend.design-system.service.gov.uk/import-javascript/#if-our-inline-javascript-snippet-is-blocked-by-a-content-security-policy).
182196

183-
#### `skipLink` (Block)
197+
#### `govukRebrand` (Variable)
184198

185-
Override the default [Skip link component](/components/skip-link/).
199+
Enables rebranded styles. If you’ve overridden any blocks that are affected by this, you may have to make manual changes. See the [v5.10.0 release notes](https://github.com/alphagov/govuk-frontend/releases/tag/v5.10.0) for more information.
186200

187-
#### `themeColor` (Variable)
201+
#### `skipLink` (Block)
188202

189-
Set the [toolbar colour on some devices](https://developer.chrome.com/blog/support-for-theme-color-in-chrome-39-for-android).
203+
Override the default [Skip link component](/components/skip-link/).
190204

191-
#### Exploded view of the page template block areas
205+
### Exploded view of the page template block areas
192206

193207
{{ example({ group: "styles", item: "page-template", example: "block-areas", html: false, open: false }) }}

0 commit comments

Comments
 (0)