Color¶
New in version 12.0: The TCA type color
has been introduced. It replaces the
renderType=colorpicker
of TCA type input
.
The TCA type color
should be used to render a JavaScript-based color picker.
Examples¶
A simple color picker:
'a_color_field' => [
'label' => 'Color field',
'config' => [
'type' => 'color',
]
]
Migration¶
A complete migration from renderType=colorpicker
to type=color
looks like the following:
// Before
'a_color_field' => [
'label' => 'Color field',
'config' => [
'type' => 'input',
'renderType' => 'colorpicker',
'required' => true,
'size' => 20,
'max' => 1024,
'eval' => 'trim',
'valuePicker' => [
'items' => [
['typo3 orange', '#FF8700'],
],
],
],
],
// After
'a_color_field' => [
'label' => 'Color field',
'config' => [
'type' => 'color',
'required' => true,
'size' => 20,
'valuePicker' => [
'items' => [
['typo3 orange', '#FF8700'],
],
],
]
]
An automatic TCA migration is performed on the fly, migrating all occurrences
to the new TCA type and triggering a PHP E_USER_DEPRECATED
error
where code adoption has to take place.