Row Wizard
Info
This widget allows you to render one or more rows of arbitrary DCA fields. Each row consists of a configurable set of child widgets that are parsed and rendered directly by the core. The widget validates each child field individually and stores the resulting rows as a serialized array.
Features
- Parses and renders DCA field definitions directly
- Allows callbacks on the used widget fields
- Uses the existing backend Stimulus controllers
- Validation is handled by the individual child widgets
- Stores multiple rows as serialized data
- Optional drag & drop sorting (enabled by default)
- Configurable minimum and maximum number of rows
- Configurable row actions
Supported widgets
Since the Row Wizard parses DCA field definitions directly, it works with most standard widgets.
Known limitations
The following widget options and modifications do not work within the row wizard
eval.color-pickereval.datepickereval.dcaPickereval.rte- Any modifications that append JS to the widget (via
DataContainer::row()) - Custom widgets provided by extensions that are dependent on JavaScript (Stimulus controllers may work)
Additional information about known limitations can be read in the associated pull request.
Options
This table only shows the options relevant to the core functionality of this widget. See the DCA reference for a full field reference.
| Key | Value | Description |
|---|---|---|
inputType | rowWizard (string) | |
fields | array | Associative array of DCA field definitions rendered per row. |
eval.actions | array | Allowed values: copy, delete, enable. Default: ['copy', 'delete']. |
eval.sortable | bool | Enables or disables drag & drop sorting (default: true). |
eval.min | int | Minimum number of rows. |
eval.max | int | Maximum number of rows. |
Column Definition
The Row Wizard stores its data as a serialized array containing all defined rows and their field values. Since the total length cannot be predicted, a blob column is recommended.
Examples
Usage within contao/core-bundle
All options
Callback
In some cases, you may not want to save any value if there is only one row and the first* value is empty. You can implement your own save callback for this case:
* the provided example checks for the first value, you may be able to change your callback to any other field
Usage in Contao
The row wizard widget is used in the Description list content element for example in order to be able to enter the list of description terms (the “key”) and description details (the “value”).
