Skip to content

Commit

Permalink
Further changes from SME review
Browse files Browse the repository at this point in the history
  • Loading branch information
m-green committed Jul 30, 2020
1 parent 689b6f9 commit 1426189
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion src/styles/page-template/index.md.njk
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,29 @@ You can customise the page template, for example, by adding a service name and n

## Changing template content

If you’re using Nunjucks, you can change the template’s content using [options](https://frontend.design-system.service.gov.uk/use-nunjucks/#changing-the-html-thats-generated).
If you’re using Nunjucks, you can change the template’s content using options.

How you set an option depends on whether it's a 'variable' option or a 'block' option.

To set a 'variable' option, use `set` to pass in a single value or string. For example, to add a class to the `<body>` element using the `bodyClasses` option:

```javascript
{% raw %}
{% set bodyClasses = "EXAMPLE-CLASS" %}
{% endraw %}
```

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
{% raw %}
{% block bodyEnd %}
<div>
<p>Example text</p>
</div>
{% endblock %}
{% endraw %}
```

To change the components that are included in the page template by default, set their equivalent blocks. For example:

Expand All @@ -52,6 +74,8 @@ To change the components that are included in the page template by default, set
{% endraw %}
```

### Options

<table class="govuk-table app-table--constrained">
<caption class="govuk-table__caption govuk-visually-hidden">Options that you can use with the page template</caption>
<thead class="govuk-table__head">
Expand Down

0 comments on commit 1426189

Please sign in to comment.