Summary - smbc-digital/form-builder GitHub Wiki
Summary
This element displays a summary of the answers given. It displays a table of answers mapped to the element label
DSL properties
Property | Type | Required | Default Value | Description |
---|---|---|---|---|
AllowEditing | bool | ❌ | false | Determines whether to show the link to the form page for each question |
Sections | Array[Section] | ❌ | [] | Allow you to split up the summary into sections |
Section object
Property | Type | Required | Default Value | Description |
---|---|---|---|---|
Title | string | ✔️ | '' | The title for the summary section |
Pages | Array[string] | ✔️ | [] | The page slugs which you want to be grouped under the section title. |
The example below would group page-one
, page-two
in one section and page-three
in a serperate section.
{
"Title": "Section one",
"Pages": [
"page-one",
"page-two"
]
},
{
"Title": "Section two",
"Pages": [
"page-three"
]
}
Summary examples
DS Json for summary with editing:
{
"Type": "Summary",
"Properties": {
"AllowEditing" : true
}
},
NOTE - The 'change' links will always be styled as 'visited links' as they are links to form pages already visited during the user journey.
DS Json for summary without editing:
{
"Type": "Summary",
"Properties": {
"AllowEditing" : false
}
},
Json for summary with sections
{
"Type": "Summary",
"Properties": {
"AllowEditing" : true,
"Sections": [
{
"Title": "Personal details",
"Pages": [
"name",
"dob"
]
},
{
"Title": "Application details",
"Pages": [
"previous-application"
]
}
]
}
}