【问题标题】:TYPO3 10.4.20 and b13/containersTYPO3 10.4.20 和 b13/容器
【发布时间】:2021-08-24 14:33:04
【问题描述】:

我在typo3 10.4.20 composer 安装上安装了b13/container 扩展。我想用容器替换网格元素。基于documentation,您可以通过对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?

【问题讨论】:

  • 您将 tt_content.php 放在哪个文件夹中?文件的其余部分是否有效(eftmg_categorizedpages 的 addTcaSelectItem 和 showitem)?您是否清除了所有缓存(也可能通过安装工具)?您是否检查过 EXT:container 是否真的加载了,例如在 PackageStates.php 文件中?

标签: typo3 typo3-extensions typo3-10.x


【解决方案1】:

您可以查看https://github.com/b13/container-example,它提供了一个带有 2 列的示例容器,使用 TCA 将其添加到 NewContentElement-Wizard 中。

我也在 10.4.20 上运行,它工作正常,可能是你的容器 TCA。没有测试它,但你应该看看上面提到的例子。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多