0

我尝试制作自己的发行版,但仍停留在 TCA 脚本中……我尝试制作自己的内容元素,这也有效。但是,如果我想将 Textarea 显示为 RichTextEditor 或将 Input Field 显示为 ValuePicker,它将不起作用。

所以这是我在 tt_content.php 中的代码

$GLOBALS['TCA']['tt_content']['columns']['testText'] = array(
    'exclude' => 1,
    'label' => 'LLL:EXT:PRIVATE/Resources/Private/Language/locallang_tabs.xlf:tesText',
    'config' => array(
        'type' => 'text',
        'cols' => 40,
        'rows' => 6,
        'wizards' => array(
            '_PADDING' => 2,
            'RTE' => array(
                'notNewRecords' => 1,
                'RTEonly' => 1,
                'type' => 'script',
                'title' => 'Full Test',
                'module' => array(
                    'name' => 'wizard_rte'
                ),
                'icon' => 'wizard_rte2.gif'
            )
        ),
        'enableRichtext' => true,
        'defaultExtras' => 'richtext[]'
    )
);

在后端,我只能看到正常的 Textarea,没有 RTE,甚至没有 ValuePicker。即使我将调色板类型更改为 Bodytext 如下,也有一个 Textarea。

$GLOBALS['TCA']['tt_content']['types']['PRIVATE_termin'] = array(
   'showitem' => '
         --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xml:palette.general;general,
         --palette--;LLL:EXT:PRIVATE/Resources/Private/Language/locallang_tabs.xlf:general, header, bodytext, termin, termin2, platz, farbe
');

我将 ValuePicker 定义如下:

$GLOBALS['TCA']['tt_content']['columns']['farbe'] = array(
   'label' => 'LLL:EXT:PRIVATE/Resources/Private/Language/locallang_tabs.xlf:farbe',
   'config' => array(
        'type' => 'input',
        'size' => 20,
        'valuePicker' => array(
            'items' => array(
                ['#496D0C', '<font color="#496D0C">Neutral</font>'],
                ['#91AD33', '<font color="#91AD33">Gr&uuml;n</font>'],
                ['#F59B00', '<font color="#F59B00">Gelb</font>'],
                ['#CD1013', '<font color="#CD1013">Rot</font>']
            ),
        )
   )
);

我也尝试删除 HTML 标签,但它仍然无法正常工作。

期待收到你的消息 :)

制造商阿斯卡瓦斯

4

3 回答 3

1

据我所知,valuePickerTYPO3 7.6 不支持,但仅 TYPO3 v8 支持。

它于2017年1月推出;https://github.com/TYPO3/TYPO3.CMS/commit/84be5e616b5373ac7ba57edf2d3cd61251dc6f97

在 TYPO3 7.6 中,您需要一个选择向导 - https://docs.typo3.org/typo3cms/TCAReference/7.6/AdditionalFeatures/WizardsConfiguration/Index.html#select-wizards

于 2017-05-30T10:22:10.890 回答
1

您可以使用“columnsOverrides”启用 RTE

$GLOBALS['TCA']['tt_content']['types']['startpilot_textimage'],
    [
        'showitem' => $showitem_default_01 . '
        header;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:header_formlabel,
        header_layout;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:header_layout_formlabel,
        imageposition,
        image,
        bodytext,
        ' . $showitem_default_02,
        'columnsOverrides' => [
            'bodytext' => ['defaultExtras' => 'richtext:rte_transform[mode=ts_css]'],
            'image' => array(
                'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
                    'image',
                    array(
                        'collapseAll' => 1,
                        'maxitems' => 1,
                    )
                ),
            ),
        ]
    ]

于 2017-04-12T11:04:25.260 回答
0

对于 TYPO3 7 LTS。RTE 字段的 TCA 配置。如下所示。

'description' => array(
    'exclude' => 1,
    'label' => 'LLL:EXT:ext_list/Resources/Private/Language/locallang_db.xlf:tx_extlist_domain_model_extlist.description',
    'config' => array(
           'type' => 'text',
           'cols' => '30',
           'rows' => '3'
    ),
    'defaultExtras' => 'richtext[strong|emphasis]:rte_transform[ts]'
),
于 2017-04-12T12:17:45.090 回答