typo3 - TYPO3 10.4.20 和 b13/容器
问题描述
我在typo3 10.4.20 composer 安装上安装了 b13/container 扩展。我想用容器替换网格元素。根据文档,您可以通过对 TCA Registry 进行 PHP 调用来注册新的内容元素。但是在执行完所有步骤后,它不会将“容器”选项卡添加到新内容元素向导中。
这是我的 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')
);
也许我必须将我的版本降级到 TYPO3 10.4.18?
解决方案
您可以查看https://github.com/b13/container-example,它提供了一个带有 2 列的示例容器,使用 TCA 将其添加到 NewContentElement-Wizard 中。
我也在 10.4.20 上运行,它工作正常,可能是容器的 TCA .. 没有测试它,但你应该好好看看上面提到的例子。
推荐阅读
- python - Jupyter Notebook 停止在浏览器视图中显示所有文件夹/文件
- python - 找到机器人可以安全访问网格上的点的最大区域
- python-3.x - 为什么我的链接列表不打印所有值?
- python - 我的推特回复在原始状态后没有出现
- powershell - Powershell:获取超过 30 个滚动天的值
- javascript - React Native/Firebase/Expo Audio - 在下载开始并且用户离开页面后取消 loadAsync
- outlook - 我应该为这个 com_error 使用什么名称?
- google-apps-script - 脚本期间共享的工作表
- python - 计算两个质心之间的距离
- c++ - CMake ExternalData 自定义获取脚本