Reputation: 11
I want to add an existing tab to special pagetype. For example tab "social media" to pagetype 254 (folder). So i used mergeRecursiveWithOverrule like this, but then i redefine all. Can i only add a single tab?
\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule(
$GLOBALS['TCA']['pages'],
[
'types' => [
254 => [
'showitem' => '
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general, --palette--;;standard, --palette--;;titleonly, ,
--div--;LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.tabs.socialmedia, --palette--;;opengraph, --palette--;;twittercards,
,...
,
'
]
],
],
);
Thanks
Upvotes: 0
Views: 1092
Reputation: 2557
ExtensionManagementUtility::addToAllTCAtypes()
is what you are looking for, especially the third parameter.
Parameters of addToAllTCAtypes()
:
Name of the table to which the fields should be added.
Comma-separated string of fields, the same syntax used in the showitem property of types in TCA.
Optional: record types of the table where the fields should be added, see types in TCA for details.
Optional: position ('before' or 'after') in relation to an existing field.
Docs: Extension Development -> Extending the TCA array -> Customization Examples
Upvotes: 1