Text

type => 'input' // TCA

The Text type generates a simple input field, possibly with additional features applied.

Settings

default
Required

false

Type

string

Default value set if a new record is created.

max
Required

false

Type

integer

Value for the maxlength attribute of the <input> field. Javascript prevents adding more than the given number of characters.

min
Required

false

Type

integer

Value for the minlength attribute of the <input> field. Javascript prevents adding less than the given number of characters. Note: Empty values are still allowed. Use in combination with required if this should be a non-empty value.

placeholder
Required

false

Type

string

Placeholder text for the field.

required
Required

false

Type

boolean

Default

false

If set, the field becomes mandatory.

size
Required

false

Type

integer

Abstract value for the width of the <input> field.

valuePicker
Required

false

Type

array

Renders a select box with static values next to the input field. When a value is selected in the box, the value is transferred to the field. Keys:

items (array)
An array with selectable items. Each item is an array with the first being the label in the select drop-down (LLL reference possible) and the second being the value transferred to the input field.

Example:

valuePicker:
  items:
    - [ 'Want to join our team? Take the initiative!', 'Job offer general' ]
    - [ 'We are looking for ...', 'Job offer specific' ]
Copied!

For more advanced configuration refer to the TCA documentation.

Examples

Minimal

name: example/text
fields:
  - identifier: text
    type: Text
Copied!

Advanced / use case

name: example/text
fields:
  - identifier: text
    type: Text
    default: 'Default value'
    min: 4
    max: 15
    required: true
Copied!