[TYPO3-dev] custom palette for sys_file_reference

Stefan Franke stefan.franke at gmx.co.uk
Tue Jun 14 10:49:04 CEST 2016


Hello,

I'm trying create a banner extension based on fluid_styled_content, that allows me to add multiple FAL images with custom sys_file_reference fields. Extending fluid_styled_content was easy, but adding custom fields in sys_file_reference for that particular content element only (!) seems more complicated than I expected :/

This is what I've got so far - I'm creating a custom palette ("bannerPalette") for my new content element "banner":

--- CODE (TCA/Overrides/sys_file_reference.php) -----------

$tempColumnsBanner = array(
    'teaser' => array(
        'exclude' => 1,
        'label' => 'Teaser',
        'config' => array(
            'type' => 'input'
            'size' => 20,
            'eval' => 'trim',
        )
    ),
);

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns(
    'sys_file_reference',
    $tempColumnsBanner
);

$GLOBALS['TCA']['sys_file_reference']['palettes']['bannerPalette']['showitem'] = '';

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToPalette(
    'sys_file_reference',
    'bannerPalette',
    'link,--linebreak--,position,teaser'
);

--- CODE (end) --------------------------------------------


What I don't know is how to add this palette for images to my content element. Please help, thanks!

Kind regards,
Stefan



More information about the TYPO3-dev mailing list