Feature #78078

Flexform: Support ds_pointerField pointing to a foreign record

Added by Sebastian Michaelsen about 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend API
Target version:
-
Start date:
2016-09-27
Due date:
% Done:

0%

PHP Version:
Tags:
Complexity:
Sprint Focus:

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.


Related issues

Related to TYPO3 Core - Bug #77710: Configure the "rel" parameter for embedded Youtube videos Closed 2016-08-31

History

#1 Updated by Christian Kuhn about 3 years ago

i think that's possible with ds_pointerfields and friends. please see the docu for details on that.

#2 Updated by Christian Kuhn about 3 years ago

  • Status changed from New to Needs Feedback

#3 Updated by Riccardo De Contardi almost 3 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.

Also available in: Atom PDF