Skip to content

Commit

Permalink
Add info on default components in page template
Browse files Browse the repository at this point in the history
  • Loading branch information
EoinShaughnessy committed May 25, 2022
1 parent 9dcbcae commit 0642b7f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/components/footer/index.md.njk
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ The footer provides copyright, licensing and other information about your servic

{{ example({group: "components", item: "footer", example: "default", id: "default-1", html: true, nunjucks: true, open: false, size: "m"}) }}

If you use the page template, you'll also get the footer without having to add it, as it's included by default. However, if you want to customise the default footer, read the [page template guidance about customising components](/styles/page-template/#changing-template-content).

## When to use this component

Use the footer at the bottom of every page of your service.
Expand Down
2 changes: 2 additions & 0 deletions src/components/header/index.md.njk
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ The GOV.UK header shows users that they are on GOV.UK and which service they are

{{ example({group: "components", item: "header", example: "default", id: "default-1", html: true, nunjucks: true, open: false}) }}

If you use the page template, you'll also get the header without having to add it, as it's included by default. However, if you want to customise the default header, read the [page template guidance about customising components](/styles/page-template/#changing-template-content).

## When to use this component

You must use the GOV.UK header at the top of every page if your service is being hosted on one of these domains:
Expand Down
2 changes: 2 additions & 0 deletions src/components/skip-link/index.md.njk
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Use the skip link component to help keyboard-only users skip to the main content

{{ example({group: "components", item: "skip-link", example: "default", html: true, nunjucks: true, open: false}) }}

If you use the page template, you'll also get the skip link without having to add it, as it's included by default. However, if you want to customise the default skip link, read the [page template guidance about customising components](/styles/page-template/#changing-template-content).

## When to use this component

All GOV.UK pages must include a skip link. Usually, you should place the skip link immediately after the opening `<body>` tag. However, if you're using a [cookie banner](/components/cookie-banner/), place the skip link immediately after the cookie banner.
Expand Down
8 changes: 7 additions & 1 deletion src/styles/page-template/index.md.njk
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ This example shows the minimum required for a GOV.UK page.

## Customised page template

You can customise the page template, for example, by adding a service name and navigation or adding a block before the main container to include a [back link](/components/back-link/) or [phase banner](/components/phase-banner/).
You can customise the page template, for example, by:

- adding a service name and navigation
- including a [back link](/components/back-link/) or [phase banner](/components/phase-banner/)


{{ example({group: "styles", item: "page-template", example: "custom", customCode: true, html: true, nunjucks: true, open: false, size: "xl" }) }}

Expand All @@ -50,6 +54,8 @@ To set a 'variable' option, use `set` to pass in a single value or string. For e
{% endraw %}
```

By default, the template contains a [skip link](/components/skip-link/), [header](/components/header/) and [footer](/components/footer/), all of which require 'blocks' to change.

To set a 'block' option, use `block` to pass in a multiline value or HTML markup. For example, to add a block of HTML before the closing </body> element in the page template using the `bodyEnd` option:

```javascript
Expand Down

0 comments on commit 0642b7f

Please sign in to comment.