I have an extension which extends the tt_content table of some fields but got trouble with the positioning of the fields in the backend, the fields itself are correctly shown and can be used in the frontend ... heres some code from Configuration/TCA/Overrides/tt_content.php
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToPalette(
'tt_content',
'general',
'tx_ceplus_fontcolor',
'after:header'
);
I have this code and the field appears in the backend but its not after the header, instead its at the end of the header section (also tried to positioned it after header_typ, header_position but its not working) any ideas?
The problem should be the palette you try to add the field to, since the general
palette does not contain the header
field, but both header
and headers
do.
/**
* Adds new fields to a palette.
* If the palette does not exist yet, it's created automatically.
* FOR USE IN files in Configuration/TCA/Overrides/*.php Use in ext_tables.php FILES may break the frontend.
*
* @param string $table Name of the table
* @param string $palette Name of the palette to be extended
* @param string $addFields List of fields to be added to the palette
* @param string $insertionPosition Insert fields before (default) or after one
*/
public static function addFieldsToPalette($table, $palette, $addFields, $insertionPosition = '')