【问题标题】:TYPO3: Override field bodytext to load rte_ckeditor in extensionTYPO3:覆盖字段正文以在扩展中加载 rte_ckeditor
【发布时间】:2020-02-24 08:59:47
【问题描述】:

我目前正在将 TYPO3(以及已安装的自定义扩展)从 6.2 更新到 8.7。扩展创建一些自定义内容元素,使用“extbuilder”构建。到目前为止一切都很好,但是 rte_ckeditor 没有在这些内容元素的后端加载。 rte_ckeditor 已安装并在标准内容元素中工作。

我在这里https://docs.typo3.org/m/typo3/reference-tca/8.7/en-us/ColumnsConfig/Type/Text.html 使用columnsOverrides 尝试了第二个示例“rte_1”。这是我在typo3conf/ext/myExt/Configuration/TCA/Overrides/tt_content.php 文件中的代码

    $GLOBALS['TCA']['tt_content']['types']['myext']['columnsOverrides'] = array(
    'bodytext' => array(
        'config' => array(
            'type' => 'text',
            'enableRichtext' => true,
        )
    )
);

在我的 ext_tables.php 中,该字段已加载:

$TCA['tt_content']['types']['myext_callout']['showitem'] = 'CType, header;Überschrift, subheader;Untertitel, image, bodytext;Beschreibung Preis/Leistung';

你有什么想法,为什么编辑器没有加载?

【问题讨论】:

    标签: typo3 extbase


    【解决方案1】:

    问题解决了。这是 tt_content.php 中的正确代码:

    $customFields = [
        'bodytext' => [
            'exclude' => false,
            'l10n_mode' => 'prefixLangTitle',
            'label' => 'Inhalt',
            'config' => [
                'type' => 'text',
                'cols' => 40,
                'rows' => 6,
                'enableRichtext' => true
            ],
        ]
    ];
    \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('tt_content',$customFields);
    

    【讨论】:

      猜你喜欢
      • 2021-09-06
      • 1970-01-01
      • 2023-01-04
      • 2016-10-17
      • 2011-09-27
      • 2019-01-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多