You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: standardize Liquid syntax references in documentation
- Updated various documentation files to replace HTML-encoded Liquid syntax with the standard format `{{ ... }}` for consistency and clarity.
- Ensured that all instances of `context.data` and related examples reflect the correct syntax, improving readability and preventing rendering issues.
Copy file name to clipboardExpand all lines: docs/features/code-based/PAGE_VIEWS.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,4 +19,4 @@ The main template layout is `govuk-frontend`'s `template.njk` file, this also ne
19
19
20
20
## Using page views with data from your own API
21
21
22
-
Page templates have access to `{{ context.data }}`, which is an attribute made available when a page event is triggered. It represents the entire response body from your API. To learn more about this, [see our guidance on page events](../configuration-based/PAGE_EVENTS.md).
22
+
Page templates have access to `{{ context.data }}`, which is an attribute made available when a page event is triggered. It represents the entire response body from your API. To learn more about this, [see our guidance on page events](../configuration-based/PAGE_EVENTS.md).
Copy file name to clipboardExpand all lines: docs/features/configuration-based/PAGE_EVENTS.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ Page events are a configuration-based way of triggering an action on an event tr
11
11
12
12
DXT's forms engine is a frontend service, which should remain as lightweight as possible with business logic being implemented in a backend/BFF API. Using page events, DXT can call your API and use the tailored response downstream, such a page templates to display the response value.
13
13
14
-
The downstream API response becomes available under the `{{ context.data }}` view model attribute for view templates, so it can be used when rendering a page. This attribute is directly accessible by our [page templates](./../configuration-based/PAGE_TEMPLATES.md) feature and our Nunjucks-based views.
14
+
The downstream API response becomes available under the `{{ context.data }}` view model attribute for view templates, so it can be used when rendering a page. This attribute is directly accessible by our [page templates](./../configuration-based/PAGE_TEMPLATES.md) feature and our Nunjucks-based views.
15
15
16
16
## Architecture
17
17
@@ -115,10 +115,11 @@ Your API response:
115
115
Page template:
116
116
117
117
```jinja2
118
-
{% if context.data.awardedGrantValue %}
119
-
<p class="govuk-body">Congratulations. You are likely to receive up to £{{ context.data.awardedGrantValue }}.</p>
120
-
{% endif %}
118
+
{% if context.data.awardedGrantValue %}
119
+
<p class="govuk-body">Congratulations. You are likely to receive up to £{{ context.data.awardedGrantValue }}.</p>
120
+
{% endif %}
121
121
<p class="govuk-body">You have not been awarded any funding for this application.</p>
Copy file name to clipboardExpand all lines: docs/features/configuration-based/PAGE_TEMPLATES.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,7 +61,7 @@ The following elements support [LiquidJS templates](https://liquidjs.com/):
61
61
## Template data
62
62
63
63
The data the templates are evaluated against is the raw answers the user has provided up to the page they're currently on.
64
-
For example, given a YesNoField component called `TKsWbP`, the template `{{ TKsWbP }}` would render "true" or "false" depending on how the user answered the question.
64
+
For example, given a YesNoField component called `TKsWbP`, the template `{{ TKsWbP }}` would render "true" or "false" depending on how the user answered the question.
65
65
66
66
The current FormContext is also available as `context` in the templates. This allows access to the full data including the path the user has taken in their journey and any miscellaneous data returned from `Page event`s in `context.data`.
67
67
@@ -158,4 +158,4 @@ Whilst DXT offers some out of the box filters, teams using the plugin have the c
158
158
159
159
## Using page templates with data from your own API
160
160
161
-
Page templates have access to`{{ context.data }}` , which is an attribute made available when a page event is triggered. It represents the entire response body from your API. To learn more about this, [see our guidance on page events](./PAGE_EVENTS.md).
161
+
Page templates have access to``{{ context.data }}` , which is an attribute made available when a page event is triggered. It represents the entire response body from your API. To learn more about this, [see our guidance on page events](./PAGE_EVENTS.md).
Copy file name to clipboardExpand all lines: src/server/plugins/engine/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ The following elements support [LiquidJS templates](https://liquidjs.com/):
18
18
### Template data
19
19
20
20
The data the templates are evaluated against is the raw answers the user has provided up to the page they're currently on.
21
-
For example, given a YesNoField component called `TKsWbP`, the template `{{ TKsWbP }}` would render "true" or "false" depending on how the user answered the question.
21
+
For example, given a YesNoField component called `TKsWbP`, the template `{{ TKsWbP }}` would render "true" or "false" depending on how the user answered the question.
22
22
23
23
The current FormContext is also available as `context` in the templates. This allows access to the full data including the path the user has taken in their journey and any miscellaneous data returned from `Page event`s in `context.data`.
0 commit comments