Why not? TCA config is nothing more than PHP array, so you can include_once()
your partial file and just combine it with 'main' TCA, just always try to make sure that the name of variable is unique in whole system especially when you wanna to make many partials (ie: $TxMyextTCApartForAandB
):
_partial.php
<?php
$TxMyextCommonPartial = array(
'interface'=> array(
'showRecordFieldList' => 'name, url',
),
'types' => array(
'1' => array('showitem' => 'name, url'),
),
'columns' => array(
'name' => array(
'exclude' => 0,
'label' => 'Name of item',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'url' => array(
'exclude' => 0,
'label' => 'URL of item',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
),
);
A_TCA.php:
<?php
if (!defined ('TYPO3_MODE')) {
die ('Access denied.');
}
include_once('_partial.php');
$TCA['tx_myext_domain_model_atable'] = array(
'ctrl' => $TCA['tx_myext_domain_model_atable']['ctrl'],
'interface' => array(
'showRecordFieldList' => $TxMyextCommonPartial['interface']['showRecordFieldList'].', additional_field_only_in_a_tca',
),
'types' => array(
'1' => $TxMyextCommonPartial['types']['1']['showitem'].', additional_field_only_in_a_tca',
),
'palettes' => array(
'1' => array('showitem' => ''),
),
'columns' => array(
'name' => $TxMyextCommonPartial['columns']['name'],
'url' => $TxMyextCommonPartial['columns']['url'],
'additional_field_only_in_a_tca' => array(
'exclude' => 0,
'label' => 'Additional field in A only',
'config' => array(
'type' => 'input',
'size' => 4,
'eval' => 'int'
),
),
),
);
or even...
include_once('_partial.php');
$TCA['tx_myext_domain_model_atable'] = array(
'ctrl' => $TCA['tx_myext_domain_model_atable']['ctrl'],
'interface' => $TxMyextCommonPartial['interface'],
'types' => $TxMyextCommonPartial['types'],
'palettes' => $TxMyextCommonPartial['palettes'],
'columns' => $TxMyextCommonPartial['columns'],
);