Project

General

Profile

Actions

Feature #78078

closed

Flexform: Support ds_pointerField pointing to a foreign record

Added by Sebastian Michaelsen over 7 years ago. Updated over 7 years ago.

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

0%

Estimated time:
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 1 (0 open1 closed)

Related to TYPO3 Core - Bug #77710: Configure the "rel" parameter for embedded Youtube videosClosedSebastian Michaelsen2016-08-31

Actions
Actions

Also available in: Atom PDF