简体   繁体   English

TYPO3 TCA 页面类型添加选项卡

[英]TYPO3 TCA pages types add Tab

I want to add an existing tab to special pagetype.我想将现有选项卡添加到特殊页面类型。 For example tab "social media" to pagetype 254 (folder).例如标签“社交媒体”到页面类型 254(文件夹)。 So i used mergeRecursiveWithOverrule like this, but then i redefine all.所以我像这样使用 mergeRecursiveWithOverrule,但后来我重新定义了所有。 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谢谢

ExtensionManagementUtility::addToAllTCAtypes() is what you are looking for, especially the third parameter. ExtensionManagementUtility::addToAllTCAtypes()是您要查找的内容,尤其是第三个参数。

Parameters of addToAllTCAtypes() : addToAllTCAtypes()的参数:

  1. Name of the table to which the fields should be added.应向其添加字段的表的名称。

  2. Comma-separated string of fields, the same syntax used in the showitem property of types in TCA.逗号分隔的字段字符串,与 TCA 中类型的 showitem 属性中使用的语法相同。

  3. Optional: record types of the table where the fields should be added, see types in TCA for details.可选:记录应添加字段的表的类型,详见TCA中的类型。

  4. Optional: position ('before' or 'after') in relation to an existing field.可选:与现有字段相关的 position(“之前”或“之后”)。

Docs: Extension Development -> Extending the TCA array -> Customization Examples文档: 扩展开发 -> 扩展 TCA 阵列 -> 自定义示例

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM