overrideChildTca

overrideChildTca
Path

$GLOBALS['TCA'][$table]['columns'][$field]['config']

Type

array

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
                           ],
                        ],
                     ],
                  ],
               ],
            ],
         ],
      ],
   ],
],

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',
            ],
         ],
      ],
   ],
],

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',
               ],
            ],
         ],
      ],
   ],
];

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
                  ],
               ],
            ],
         ],
      ],
   ],
],

Note

It is allowed to use this property within the columnsOverrides property of an inline parent in the ['types'] section.

Example

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