Margins

Note

This widget has been deprecated in Contao 5.7 in favor of the Row Wizard widget.

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 Margins

Options

This table only shows the options relevant to the core functionality of this widget. See the DCA reference for a full field reference. All options for the text widget are also relevant.

KeyValueDescription
inputTypetrbl (string)
optionsarrayThese are the options available in the unit drop-down. You can also use an options_callback.
referencearrayOptional 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

// …
'myMargins' => [
    'label' => ['Margins', 'The margins for this element.'],
    'inputType' => 'trbl',
    'options' => 'px', '%', 'em', 'rem',
    'sql' => [
        'type' => 'string',
        'length' => 128,
        'default' => '',
        'platformOptions' => [
            'collation' => 'ascii_bin',
        ],
    ],
],
// …