Feature #78078
closedFlexform: Support ds_pointerField pointing to a foreign record
0%
Description
The field defined in ds_pointerField
decides which FlexForm should be displayed so you can have different FlexForms for different "types" of records. I'm proposing to add the ability to read a related foreign field which determines which FlexForm to use.
Real world example: I want to display a FlexForm in sys_file_reference based on the mime type the file has. But the mime type is not available in the sys_file_reference record but in the related sys_file record.
(See https://forge.typo3.org/issues/77710 for more information on the real world example)
Im proposing to use the following syntax, which divides local and foreign field by colon:
$GLOBALS['TCA']['sys_file_reference']['columns']['mediaoptions'] = [ 'label' => 'Options', 'config' => [ 'type' => 'flex', 'ds_pointerField' => 'uid_local:mime_type', 'ds' => [ 'video/vimeo' => 'FILE:EXT:mediaoptions/Configuration/FlexForms/Vimeo.xml', 'video/youtube' => 'FILE:EXT:mediaoptions/Configuration/FlexForms/YouTube.xml', ], ], ];
I'm proposing this syntax because since TYPO3 4.7 there's already a very similar functionality for the ['ctrl']['type']
field.
https://docs.typo3.org/typo3cms/TCAReference/latest/Reference/Ctrl/#type
For my real world extension I already solved this via a hook: https://github.com/smichaelsen/typo3-mediaoptions/blob/master/Classes/Hooks/GetFlexformDataStructureHook.php
(Tested only with TYPO3 7 so far)
Any feedback is welcome.
Updated by Christian Kuhn almost 8 years ago
i think that's possible with ds_pointerfields and friends. please see the docu for details on that.
Updated by Christian Kuhn almost 8 years ago
- Status changed from New to Needs Feedback
Updated by Riccardo De Contardi over 7 years ago
- Status changed from Needs Feedback to Closed
- Assignee deleted (
Sebastian Michaelsen)
No feedback within 90 days > closing this issue.
If you think that this is the wrong decision, please reopen it or open a new issue with a reference to this one. Thank you.