I have created a custom content element without extending the tt_content columns because the existing fields in the database are sufficient for what I need.
I am using "header", "header_link" and "image" but I need the "image" column to have a different TCA configuration when it's used in my custom content element.
I can change the configuration globally:
$GLOBALS['TCA']['tt_content']['columns']['image']['config']['maxitems'] = 1;
but that's not what I want.
Something like
$GLOBALS['TCA']['tt_content']['my_custom_element']['columns']['image']['config']['maxitems'] = 1;
or
$GLOBALS['TCA']['tt_content']['columns']['my_custom_element']['image']['config']['maxitems'] = 1;
isn't working.
Does anyone know how to accomplish what I want? Thanks! :-)
TCA config of columns is some kind of final, that means they are cached once and it's not possible to use different configs for one field depending on any conditions.
The typical solution is adding custom image field ie.
my_image
to thett_content
and replacing originalimage
field within your CE type onlylike (sample):