I'm using TYPO3 12.4.6
I want to add an extra Subtitle attribute (input field) beside the existing Title to the Image element and I want to store it into the sys_file_reference table.
The following image contains the Image element, which should be extended with the new attribute:
I've already tried to to do it using ExtensionManagementUtility::addTCAcolumns, and ExtensionManagementUtility::addToAllTCAtypes , but it isn't working. The full code I wrote:
<?php
defined('TYPO3') or die();
$fields = [
'subtitle' => [
'label' => 'Subtitle',
'config' => [
'type' => 'input',
'eval' => 'trim'
]
]
];
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('sys_file_reference', $fields);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes(
'sys_file_reference',
'subtitle',
'',
'before:crop'
);
So, to repeat the question: How can I add new input filed/attribute to the existing Image element?

Where have you defined the property for that field? I'm pretty sure you need one and of course a partial for that property to be able to render it. Can