$GLOBALS['TCA']['tt_content']['types'][$myCType]['columnsOverrides']['imagecols']['config']['items'] = [[2,2],[3,3]];

But above not working it just replace fist two items with my list but other items are still visible how can i override items array for my custom ctype?

2

There are 2 best solutions below

1
On

It seems, \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule(), which is used to handle the columnsOverrides, does allow unsetting a key (or array), but not replacing a substructure. Maybe it's possible to find a combination of unsetting and afterwards merging with new values.

0
On

In this case you can use TCEFORM to solve your task.

TCEFORM.tt_content.imagecols.types.myCType.keepItems = 2,3