Reputation: 31
I have installed b13/container extension on a typo3 10.4.20 composer installation. I want to replace grid elements with containers. Based on the documentation you can register a new Content Element by making a PHP call to TCA Registry. But after following all the steps it doesn't add a “Container” tab to the New Content Element Wizard.
Here is my tt_content.php
<?php
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem(
'tt_content',
'CType',
[
'Great',
'examples_newcontentelement',
'content-text',
],
'textmedia',
'after'
);
// Configure the default backend fields for the content element
$GLOBALS['TCA']['tt_content']['types']['eftmg_categorizedpages'] = [
'showitem' => '
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general,
--palette--;;general,
--palette--;;headers,
selected_categories,
category_field,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.appearance,
--palette--;;frames,
--palette--;;appearanceLinks,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.accessibility,
--palette--;;menu_accessibility,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language,
--palette--;;language,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access,
--palette--;;hidden,
--palette--;;access,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:categories,
categories,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:notes,
rowDescription,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:extended,
',
'columnsOverrides' => [
'selected_categories' => [
'config' => [
'minitems' => 1,
]
],
'category_field' => [
'config' => [
'itemsProcConfig' => [
'table' => 'pages'
]
]
]
]
];
// Configure containers
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\B13\Container\Tca\Registry::class)->configureContainer(
(
new \B13\Container\Tca\ContainerConfiguration(
'b13-3col-container', // CType
'3 Columns', // label
'Some Description of the Container', // description
[
[
['name' => 'left', 'colPos' => 200],
['name' => 'middle', 'colPos' => 201],
['name' => 'right', 'colPos' => 202]
]
] // grid configuration
)
)
->setIcon('EXT:tourismus/Resources/Public/Icons/b13-3col-container.svg')
);
Maybe I have to downgrade my version to TYPO3 10.4.18?
Upvotes: 0
Views: 1487
Reputation: 56
You may take a look at https://github.com/b13/container-example which provides an example container with 2-columns using TCA to add it into the NewContentElement-Wizard.
I'm also running on 10.4.20 and it works fine, might be your TCA for the container.. didn't test it but you should be good taking a look into the upper mentioned example.
Upvotes: 1