I am still trying to tranform the TCA definition to an Flexform XML definition. I am working with T3 11.5.25. In T3 12 this is - as far as I know - deprecated and replaced by "type=file". But this is not available in T3 11.
'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'
),
],
The class \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig takes the following parameters:
public static function getFileFieldTCAConfig($fieldName, array $customSettingOverride = [], $allowedFileExtensions = '', $disallowedFileExtensions = '')
my translation so far:
<!-- Icon File -->
<settings.flexform.iconFile>
<TCEforms>
<displayCond>FIELD:settings.flexform.iconSet:!=:</displayCond>
<label>LLL:EXT:av_vcard/Resources/Private/Language/Backend.xlf:plugin.avvcard.icon.file</label>
<config>
<type>select</type>
<renderType>selectSingle</renderType>
<itemsProcFunc>\TYPO3\CMS\Core\Utility\ExtensionManagementUtility->getFileFieldTCAConfig</itemsProcFunc>
<itemsProcConfig>
<fieldName>settings.flexform.iconFile</fieldName>
<!-- here is something missing -->
<allowedFileExtensions>gif,png,svg</allowedFileExtensions>
</itemsProcConfig>
</config>
</TCEforms>
</settings.flexform.iconFile>
The second parameter to handover can be an empty array since these are (only) ovverride parameters. If left empty, nothing (bad) happens - this is my interpretation of the code.
I tried:
<customSettingOverride></customSettingOverride>
And I tried:
<customSettingOverride>
<type>inline</type>
</customSettingOverride>
But they all bring the error:
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(): Argument #2 ($customSettingOverride) must be of type array, TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems given
Could someone help me find the error?
EDIT !!! for Thomas to explain!
I am currently on the way to develop my own extension (as starter). I have a BE plugin which shall create in the FE an icon and some text. Now I wanted to use the same BE elements in my BE flexform as B2K2 does for "texticon". But B2K2 does not have a Flexform - as far as I can see. BK2K uses a new tt_content element/type which then creates a DB record - as far as I understand the setup.
I don't want to create a DB record, just set the related information in a flexform of a STANDARD Plugin tt_content element.
As you can see, below "BE icon position" the same structure as in "texticon" of B2K2. Everything works fine. I can select the "BE icon background set" and I even can select the "BE icon background icon". All fine so far. This all is setup in the Flexform.
But! In B2K2 "texticon" after the selection of the IconSet, a list of all available icons below the select field for the icon is shown.
THIS IS THE MISSING PART in my Flexform.
Since B2K2 does not have a Flexform for this I had a look at the TCA definition and the presentation of the ICONS comes from the TCA Field "icon_file" as shown in the snippet.
Now I am trying to transform this TCA definition to a working Flexform definition.
O.K. - it's cosmetic. Since I could live with the select form but the BE user will not see how the icon looks like what he/she will select.