Dedicated RTE config per CType

2019-08-16 15:14发布

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

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
}

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

1条回答
别忘想泡老子
2楼-- · 2019-08-16 15:45

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

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

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'
            ]
        ]
    ]
];

Note: 'minimal' is the preset.

查看更多
登录 后发表回答