overrideChildTca

overrideChildTca
Type
array
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']
Scope
Display

This property can be used to override certain aspects of the child's TCA if that child record is opened inline of the given parent. Display related TCA properties of the child table can be overridden in types and columns section.

Examples

Overrides the crop variants

This example overrides the crop variants in a configured fal relation:

'assets' => [
    'config' => [
        'overrideChildTca' => [
            'columns' => [
                'crop' => [
                    'config' => [
                        'cropVariants' => [
                            'default' => [
                                'disabled' => true,
                            ],
                            'mobile' => [
                                'title' => 'LLL:EXT:ext_key/Resources/Private/Language/locallang.xlf:imageManipulation.mobile',
                                'cropArea' => [
                                    'x' => 0.1,
                                    'y' => 0.1,
                                    'width' => 0.8,
                                    'height' => 0.8,
                                ],
                                'allowedAspectRatios' => [
                                    '4:3' => [
                                        'title' => 'LLL:EXT:lang/Resources/Private/Language/locallang_wizards.xlf:imwizard.ratio.4_3',
                                        'value' => 4 / 3
                                    ],
                                    'NaN' => [
                                        'title' => 'LLL:EXT:lang/Resources/Private/Language/locallang_wizards.xlf:imwizard.ratio.free',
                                        'value' => 0.0
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ],
],
Copied!

Define which fields to show in the child table

This example overrides the showitem field of the child table TCA:

'anInlineField' => [
    'config' => [
        'type' => 'inline',
        'overrideChildTca' => [
            'types' => [
                'aForeignType' => [
                    'showitem' => 'aChildField',
                ],
            ],
        ],
    ],
],
Copied!

Override the default value of a child tables field

This overrides the default columns property of a child field in an inline relation from within the parent if a new child is created:

'anInlineField' => [
    'config' => [
        'type' => 'inline',
        'overrideChildTca' => [
            'columns' => [
                'CType' => [
                    'config' => [
                        'default' => 'image',
                    ],
                ],
            ],
        ],
    ],
];
Copied!

Override the foreign_selector field target

This overrides the foreign_selector field target field config, defined in the foreign_selector property. This is used in FAL inline relations:

'anInlineField' => [
    'config' => [
        'type' => 'inline',
        'foreign_selector' => 'uid_local',
        'overrideChildTca' => [
            'columns' => [
                'uid_local' => [
                    'config' => [
                        'appearance' => [
                            'elementBrowserType' => 'file',
                            'elementBrowserAllowed' => $allowedFileExtensions
                        ],
                    ],
                ],
            ],
        ],
    ],
],
Copied!

Example

'tt_content' => [
    'types' => [
        'myCType' => [
              'columnsOverrides' => [
                   'myForeignTableColumnInTtContent' => [
                        'config' => [
                              'overrideChildTca' => [
                                   //...  same as above
                              ],
                        ],
                   ],
              ],
        ],
    ],
],
Copied!