Exit this page Nunjucks macro options
Use options to customise the appearance, content and behaviour of this component when using a macro, for example, changing the text.
Also see the guidance on the Exit this page component page, which shows these options in use within each example.
Some options are required for the macro to work; these are marked as "Required" in the option description. Deprecated options are marked as "Deprecated".
If you're using Nunjucks macros in production with "html" options, or ones ending with "html", you must sanitise the HTML to protect against cross-site scripting exploits.
| Name | Type | Description |
|---|---|---|
| text | string |
Text for the link. If html is provided, the text option will be ignored. Defaults to "Emergency Exit this page" with ‘Emergency’ visually hidden.
|
| html | string |
HTML for the link. If html is provided, the text option will be ignored. Defaults to "Emergency Exit this page" with ‘Emergency’ visually hidden.
|
| redirect |
string |
URL to redirect the current tab to. Defaults to "https://www.bbc.co.uk/weather".
|
| id | string | ID attribute to add to the exit this page container. |
| classes | string | Classes to add to the exit this page container. |
| attributes | object | HTML attributes (for example data attributes) to add to the exit this page container. |
| activated |
string |
Text announced by screen readers when Exit this Page has been activated via the keyboard shortcut. Defaults to "Loading.".
|
| timed |
string |
Text announced by screen readers when the keyboard shortcut has timed out without successful activation. Defaults to "Exit this page expired.".
|
| press |
string |
Text announced by screen readers when the user must press Shift two more times to activate the button. Defaults to "Shift, press 2 more times to exit.".
|
| press |
string |
Text announced by screen readers when the user must press Shift one more time to activate the button. Defaults to "Shift, press 1 more time to exit.".
|