[TYPO3-dev] custom palette for sys_file_reference

Frans Saris franssaris at gmail.com
Fri Jun 17 11:48:55 CEST 2016


Hi Stefan,

you need to assign this pallette to the asset/image column of your custom
content element. For instance:

'image' => array(
            'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.images',
            'config' =>
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig('image',
array(
                'appearance' => array(
                    'createNewRelationLinkTitle' =>
'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference'
                ),
                // custom configuration for displaying fields in the
overlay/reference table
                // to use the imageoverlayPalette instead of the
basicoverlayPalette
                'foreign_types' => array(
                    '0' => array(
                        'showitem' => '
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;
bannerPalette,
--palette--;;filePalette'
                    ),
                    \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => array(
                        'showitem' => '
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;
bannerPalette,
--palette--;;filePalette'
                    ),
                )
            ), $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'])
        ),


gr. Frans



Op di 14 jun. 2016 om 10:49 schreef Stefan Franke <stefan.franke at gmx.co.uk>:

> 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
> _______________________________________________
> TYPO3-dev mailing list
> TYPO3-dev at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-dev
>



More information about the TYPO3-dev mailing list