Input

type='input' generates a html <input> field with the type attribute set to text. It is possible to apply additional features such as the valuePicker.

In the database, this field is typically set to a VARCHAR or CHAR field with appropriate length.

Deprecated since version 12.0

The following render types have been deprecated:

  • renderType=inputDateTime: Use the TCA type datetime instead.
  • renderType=colorpicker: Use the TCA type color instead.
  • renderType=inputLink: Use the TCA type link instead.

Changed in version 13.2

Tables with TCA columns set to type="input" do not need an ext_tables.sql entry anymore. The Core now creates this column automatically. For short input fields allowing less than 255 chars VARCHAR() is used, TEXT for larger input fields.

Extension authors who need or want to override default TCA schema details for whatever reason, can of course do so by defining something specific in ext_tables.sql.

Examples

Simple input field

EXT:styleguide/Configuration/TCA/tx_styleguide_elements_basic.php
[
    'columns' => [
        'input_1' => [
            'l10n_mode' => 'prefixLangTitle',
            'label' => 'input_1 description',
            'description' => 'field description',
            'config' => [
                'type' => 'input',
                'behaviour' => [
                    'allowLanguageSynchronization' => true,
                ],
            ],
        ],
    ],
]
Copied!

Input with placeholder and null handling

EXT:styleguide/Configuration/TCA/tx_styleguide_elements_basic.php
[
    'columns' => [
        'input_28' => [
            'label' => 'input_28',
            'description' => 'placeholder=__row|input_26 mode=useOrOverridePlaceholder nullable=true default=null',
            'config' => [
                'type' => 'input',
                'placeholder' => '__row|input_26',
                'nullable' => true,
                'default' => null,
                'mode' => 'useOrOverridePlaceholder',
            ],
        ],
    ],
]
Copied!

Value picker

EXT:styleguide/Configuration/TCA/tx_styleguide_elements_basic.php
[
    'columns' => [
        'input_33' => [
            'label' => 'input_33',
            'description' => 'valuePicker',
            'config' => [
                'type' => 'input',
                'size' => 20,
                'eval' => 'trim',
                'valuePicker' => [
                    'items' => [
                        [
                            'spring',
                            'Spring',
                        ],
                        [
                            'summer',
                            'Summer',
                        ],
                        [
                            'autumn',
                            'Autumn',
                        ],
                        [
                            'winter',
                            'Winter',
                        ],
                    ],
                ],
            ],
        ],
    ],
]
Copied!