每个CType的专用RTE配置 [英] Dedicated RTE config per CType

查看:131
本文介绍了每个CType的专用RTE配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为用户提供TYPO3 8.7中某些自定义内容元素的最小RTE。

I want to give the user the minimal RTE for some kinds of custom content elements in TYPO3 8.7.

我发现了这种旧方法此处,但它与TYPO3 8的ckeditor不兼容。

I found this old approach here but it is not compatible with the ckeditor of TYPO3 8.

RTE.config.tt_content.bodytext.types.ccc_teasertext {
    showButtons = bold, italic, underline, link, chMode, orderedlist, unorderedlist
    RTEHeightOverride = 600
}

RTE.config.tt_content.bodytext.types.ccc_introtext {
    showButtons = bold, italic, chMode
    RTEHeightOverride = 300
}

如何将RTE.config与新的ckeditor语法一起使用,例如 RTE.tt_content.types.textmedia.bodytext.preset = minimal

How do I use RTE.config with the new ckeditor syntax like this RTE.tt_content.types.textmedia.bodytext.preset = minimal ?

推荐答案

https://stackoverflow.com/a/55391407/4062341

TYPO3的资深开发者gautamsinh mori指出了我此处为该问题提供了解决方案:

Fellow TYPO3 developer gautamsinh mori pointed me here to a solution for the problem:

不要在PageTS中配置RTE,而是在每个内容元素的TCA覆盖中配置像这样:

Don't configure the RTE in the PageTS but in the TCA Overrides per content element like this:

$GLOBALS['TCA']['tt_content']['types']['myCustomContentElement']=[
    'showitem' => '
--palette--; LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xml:palette.general; general,header,subheader,header_link,bodytext,image,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xml:tabs.appearance,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xml:palette.frames;frames,
--div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.access,
--palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.visibility;visibility,
--palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.access;access,
--div--;LLL:EXT:lang/locallang_tca.xlf:sys_category.tabs.category, categories, tx_gridelements_container, tx_gridelements_columns
',
    'columnsOverrides' => [
        'bodytext' => [
            'config' => [
                'enableRichtext' => true,
                'richtextConfiguration' => 'minimal'
            ]
        ]
    ]
];

注意:'minimal'是预设值

这篇关于每个CType的专用RTE配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆