Search code examples
typo3typo3-9.x

Typo3 TCA Override: Add field to plugin palette


I try to add a field to the plugin palette.

$fields = [
    'filtertest' => [
        'exclude' => 1,
        'label' => 'Filter',
        'config' => [
            'type' => 'select',
            'renderType' => 'selectSingle',
            'items' => [
                ['Test 1', '1'],
                ['Test 2', '2'],
                ['Test 3', '3'],
            ]
        ],
    ]
];

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('tt_content', $fields);

// This is not working
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToPalette('tt_content', 'plugin',
    'filtertest', 'after:list_type');

// Working, but not the desired palette
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToPalette('tt_content', 'gallerySettings',
    'filtertest', 'after:imagecols');

Is it the wrong name for the plugin palette? When trying to add the field to another palette (gallerySettings) it works fine.


Solution

  • What palette plugin?
    I find no palette with this name in my installation.

    have a look in the BE module Configuration at the $GLOBALS['TCA'] (Table configuration array) -> tt_content-> palettes

    Do you mean the plugin configuration, which is done with XML?
    That's the field 'pi_flexform' which is handled in a special way you can see in the manual