diff --git a/docs/dev/reference/widgets/trbl.md b/docs/dev/reference/widgets/trbl.md index 19bcdf19f..40c9b43ee 100644 --- a/docs/dev/reference/widgets/trbl.md +++ b/docs/dev/reference/widgets/trbl.md @@ -1,6 +1,50 @@ --- title: Margins -description: Four text fields with a small unit drop-down menu (not yet documented) +description: Four text fields with a small unit drop-down menu. --- -{{< widget-notice >}} +{{% notice "note" %}} +This widget has been deprecated in Contao **5.7** in favor of the [_Row Wizard_]({{% relref "row-wizard" %}}) widget. +{{% /notice %}} + +This widget renders four text input fields, plus a unit drop-down menu. Its main purpose is to provide the possibility +to enter margin values (top, right, bottom, left - hence the internal name `trbl`). + +![Margins]({{% asset "images/dev/reference/widgets/trbl.png" %}}?classes=shadow) + +## Options + +This table only shows the options relevant to the core functionality of this widget. See the DCA reference for a +[full field reference]({{% relref "fields#reference" %}}). All options for the [`text`]({{% relref "text" %}}) widget +are also relevant. + +| Key | Value | +|-------------------|-----------------------------|--- +| `inputType` | `trbl` (string) | +| `options` | `array` | These are the options available in the unit drop-down. You can also use an [`options_callback`]({{% relref "callbacks#fields-field-options" %}}). +| `reference` | `array` | Optional translation reference for the drop-down options. + +## Column Definition + +Typically, a `VARCHAR` field of sufficient length is used, with an `ascii_bin` collation, since this field does not need +full Unicode support. + +## Example + +```php +// … +'myMargins' => [ + 'label' => ['Margins', 'The margins for this element.'], + 'inputType' => 'trbl', + 'options' => 'px', '%', 'em', 'rem', + 'sql' => [ + 'type' => 'string', + 'length' => 128, + 'default' => '', + 'platformOptions' => [ + 'collation' => 'ascii_bin', + ], + ], +], +// … +``` \ No newline at end of file diff --git a/page/assets/images/dev/reference/widgets/trbl.png b/page/assets/images/dev/reference/widgets/trbl.png new file mode 100644 index 000000000..54cc21f04 Binary files /dev/null and b/page/assets/images/dev/reference/widgets/trbl.png differ