0

I have a TCA definition. But Flexforms in T3 use the same syntax but XML format I would like to convert the existing file to XML.

Is there a simple way to do this?

        'icon_file' => [
            'label' => 'LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:field.icon_file',
            'displayCond' => 'FIELD:icon_set:REQ:false',
            'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
                'icon_file',
                [
                    'appearance' => [
                        'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference'
                    ],
                    'overrideChildTca' => [
                        'types' => [
                            \TYPO3\CMS\Core\Resource\File::FILETYPE_UNKNOWN => [
                                'showitem' => '
                                    --palette--;;filePalette
                                '
                            ],
                            \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [
                                'showitem' => '
                                    --palette--;;filePalette
                                '
                            ],
                            \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
                                'showitem' => '
                                    --palette--;;filePalette
                                '
                            ],
                            \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [
                                'showitem' => '
                                    --palette--;;filePalette
                                '
                            ],
                            \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [
                                'showitem' => '
                                    --palette--;;filePalette
                                '
                            ],
                            \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [
                                'showitem' => '
                                    --palette--;;filePalette
                                '
                            ],
                        ],
                    ],
                    'minitems' => 1,
                    'maxitems' => 1,
                ],
                'gif,png,svg'
            ),
        ],

I don't know what the TCA syntax is? JSON - no! JAVASCRIPT - no! What syntax type is this with "=> [" ...?

averlon
  • 325
  • 3
  • 14

1 Answers1

2

TYPO3's table configuration array (TCA) is an array structure built on PHP arrays. The syntax [] is the short form of array(), so ['one', 'two'] is the same as array('one', 'two').

AFAIK there is no automated way to transform TCA (PHP) to FlexForm (XML) but the FlexForm documentation is a good starting point to learn how to create FlexForms.

Please note that you do have all the features of TCA in FlexForms but you need to write it in XML syntax instead of the PHP syntax.

Christian Fries
  • 444
  • 3
  • 12
  • found it! The structure posted above is deprecated meanwhile ^12. There has been a new Field type "File" introduced which is easier to configure. I found an example. This will help. – averlon Mar 18 '23 at 14:54
  • Then your question is something completely different as what you wanted to know. – Thomas Löffler Mar 20 '23 at 14:00