TYPO3 为输入字段(文本区域)激活 rte
TYPO3 activating rte for an input field (textarea)
6 扩展我想为某些文本区域激活 RTE。
我的 TCA 看起来像这样:
'aufgaben' => [
'exclude' => true,
'label' => 'LLL:EXT:justo/Resources/Private/Language/locallang_db.xlf:tx_justo_domain_model_stelle.aufgaben',
'config' => [
'type' => 'text',
'cols' => 40,
'rows' => 15,
'eval' => 'trim',
'enableRichtext' => true
],
'defaultExtras' => 'richtext:rte_transform[mode=ts_css]'
],
就像文档中提到的那样 https://docs.typo3.org/typo3cms/CoreApiReference/Rte/InTheBackend/Introduction/Index.html
这应该足以启用 RTE The short story is that it's enough to set the key enableRichtext to true.
但是RTE不显示...
我的失败是什么?
提前致谢。
更新完整的 TCA
<?php
return [
'ctrl' => [
'title' => 'LLL:EXT:justo/Resources/Private/Language/locallang_db.xlf:tx_justo_domain_model_stelle',
'label' => 'titel',
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'versioningWS' => true,
'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l10n_parent',
'transOrigDiffSourceField' => 'l10n_diffsource',
'delete' => 'deleted',
'enablecolumns' => [
'disabled' => 'hidden',
'starttime' => 'starttime',
'endtime' => 'endtime',
],
'searchFields' => 'titel,aufgaben,profil,erwartungen,ort,beginn,stellung,raum',
'iconfile' => 'EXT:justo/Resources/Public/Icons/tx_justo_domain_model_stelle.gif'
],
'interface' => [
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, titel, aufgaben, profil, erwartungen, ort, beginn, stellung, raum',
],
'types' => [
'1' => ['showitem' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, titel, aufgaben;;;richtext:rte_transform[mode=ts_links], profil, erwartungen, ort, beginn, stellung, raum, --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime'],
],
'columns' => [
'sys_language_uid' => [
'exclude' => true,
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.language',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'special' => 'languages',
'items' => [
[
'LLL:EXT:lang/locallang_general.xlf:LGL.allLanguages',
-1,
'flags-multiple'
]
],
'default' => 0,
],
],
'l10n_parent' => [
'displayCond' => 'FIELD:sys_language_uid:>:0',
'exclude' => true,
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.l18n_parent',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'items' => [
['', 0],
],
'foreign_table' => 'tx_justo_domain_model_stelle',
'foreign_table_where' => 'AND tx_justo_domain_model_stelle.pid=###CURRENT_PID### AND tx_justo_domain_model_stelle.sys_language_uid IN (-1,0)',
],
],
'l10n_diffsource' => [
'config' => [
'type' => 'passthrough',
],
],
't3ver_label' => [
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.versionLabel',
'config' => [
'type' => 'input',
'size' => 30,
'max' => 255,
],
],
'hidden' => [
'exclude' => true,
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.hidden',
'config' => [
'type' => 'check',
'items' => [
'1' => [
'0' => 'LLL:EXT:lang/locallang_core.xlf:labels.enabled'
]
],
],
],
'starttime' => [
'exclude' => true,
'l10n_mode' => 'mergeIfNotBlank',
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.starttime',
'config' => [
'type' => 'input',
'size' => 13,
'eval' => 'datetime',
'default' => 0,
]
],
'endtime' => [
'exclude' => true,
'l10n_mode' => 'mergeIfNotBlank',
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.endtime',
'config' => [
'type' => 'input',
'size' => 13,
'eval' => 'datetime',
'default' => 0,
'range' => [
'upper' => mktime(0, 0, 0, 1, 1, 2038)
]
],
],
'titel' => [
'exclude' => true,
'label' => 'LLL:EXT:justo/Resources/Private/Language/locallang_db.xlf:tx_justo_domain_model_stelle.titel',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'aufgaben' => [
'exclude' => true,
'label' => 'LLL:EXT:justo/Resources/Private/Language/locallang_db.xlf:tx_justo_domain_model_stelle.aufgaben',
'config' => [
'type' => 'text',
'cols' => 40,
'rows' => 15,
'eval' => 'trim'
],
'defaultExtras' => 'richtext:rte_transform[flag=rte_enabled|mode=ts]',
],
'profil' => [
'exclude' => true,
'label' => 'LLL:EXT:justo/Resources/Private/Language/locallang_db.xlf:tx_justo_domain_model_stelle.profil',
'config' => [
'type' => 'text',
'cols' => 40,
'rows' => 15,
'eval' => 'trim',
],
'defaultExtras' => 'richtext:rte_transform[mode=ts_css]'
],
'erwartungen' => [
'exclude' => true,
'label' => 'LLL:EXT:justo/Resources/Private/Language/locallang_db.xlf:tx_justo_domain_model_stelle.erwartungen',
'config' => [
'type' => 'text',
'cols' => 40,
'rows' => 15,
'eval' => 'trim',
],
'defaultExtras' => 'richtext:rte_transform[mode=ts_css]'
],
'ort' => [
'exclude' => true,
'label' => 'LLL:EXT:justo/Resources/Private/Language/locallang_db.xlf:tx_justo_domain_model_stelle.ort',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'beginn' => [
'exclude' => true,
'label' => 'LLL:EXT:justo/Resources/Private/Language/locallang_db.xlf:tx_justo_domain_model_stelle.beginn',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'stellung' => [
'exclude' => true,
'label' => 'LLL:EXT:justo/Resources/Private/Language/locallang_db.xlf:tx_justo_domain_model_stelle.stellung',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'raum' => [
'exclude' => true,
'label' => 'LLL:EXT:justo/Resources/Private/Language/locallang_db.xlf:tx_justo_domain_model_stelle.raum',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
],
];
试试这个
'types' => [
'1' => ['showitem' => '
...,
aufgaben;;;richtext:rte_transform[mode=ts_links],
...,
'],
],
...
'columns' => [
'aufgaben' => [
'label' => 'LLL:EXT:justo/Resources/Private/Language/locallang_db.xlf:tx_justo_domain_model_stelle.aufgaben',
'config' => [
'type' => 'text',
'cols' => 80,
'rows' => 15,
'eval' => 'trim',
],
'defaultExtras' => 'richtext:rte_transform[flag=rte_enabled|mode=ts]',
],
],
6 扩展我想为某些文本区域激活 RTE。
我的 TCA 看起来像这样:
'aufgaben' => [
'exclude' => true,
'label' => 'LLL:EXT:justo/Resources/Private/Language/locallang_db.xlf:tx_justo_domain_model_stelle.aufgaben',
'config' => [
'type' => 'text',
'cols' => 40,
'rows' => 15,
'eval' => 'trim',
'enableRichtext' => true
],
'defaultExtras' => 'richtext:rte_transform[mode=ts_css]'
],
就像文档中提到的那样 https://docs.typo3.org/typo3cms/CoreApiReference/Rte/InTheBackend/Introduction/Index.html
这应该足以启用 RTE The short story is that it's enough to set the key enableRichtext to true.
但是RTE不显示...
我的失败是什么?
提前致谢。
更新完整的 TCA
<?php
return [
'ctrl' => [
'title' => 'LLL:EXT:justo/Resources/Private/Language/locallang_db.xlf:tx_justo_domain_model_stelle',
'label' => 'titel',
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'versioningWS' => true,
'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l10n_parent',
'transOrigDiffSourceField' => 'l10n_diffsource',
'delete' => 'deleted',
'enablecolumns' => [
'disabled' => 'hidden',
'starttime' => 'starttime',
'endtime' => 'endtime',
],
'searchFields' => 'titel,aufgaben,profil,erwartungen,ort,beginn,stellung,raum',
'iconfile' => 'EXT:justo/Resources/Public/Icons/tx_justo_domain_model_stelle.gif'
],
'interface' => [
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, titel, aufgaben, profil, erwartungen, ort, beginn, stellung, raum',
],
'types' => [
'1' => ['showitem' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, titel, aufgaben;;;richtext:rte_transform[mode=ts_links], profil, erwartungen, ort, beginn, stellung, raum, --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime'],
],
'columns' => [
'sys_language_uid' => [
'exclude' => true,
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.language',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'special' => 'languages',
'items' => [
[
'LLL:EXT:lang/locallang_general.xlf:LGL.allLanguages',
-1,
'flags-multiple'
]
],
'default' => 0,
],
],
'l10n_parent' => [
'displayCond' => 'FIELD:sys_language_uid:>:0',
'exclude' => true,
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.l18n_parent',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'items' => [
['', 0],
],
'foreign_table' => 'tx_justo_domain_model_stelle',
'foreign_table_where' => 'AND tx_justo_domain_model_stelle.pid=###CURRENT_PID### AND tx_justo_domain_model_stelle.sys_language_uid IN (-1,0)',
],
],
'l10n_diffsource' => [
'config' => [
'type' => 'passthrough',
],
],
't3ver_label' => [
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.versionLabel',
'config' => [
'type' => 'input',
'size' => 30,
'max' => 255,
],
],
'hidden' => [
'exclude' => true,
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.hidden',
'config' => [
'type' => 'check',
'items' => [
'1' => [
'0' => 'LLL:EXT:lang/locallang_core.xlf:labels.enabled'
]
],
],
],
'starttime' => [
'exclude' => true,
'l10n_mode' => 'mergeIfNotBlank',
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.starttime',
'config' => [
'type' => 'input',
'size' => 13,
'eval' => 'datetime',
'default' => 0,
]
],
'endtime' => [
'exclude' => true,
'l10n_mode' => 'mergeIfNotBlank',
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.endtime',
'config' => [
'type' => 'input',
'size' => 13,
'eval' => 'datetime',
'default' => 0,
'range' => [
'upper' => mktime(0, 0, 0, 1, 1, 2038)
]
],
],
'titel' => [
'exclude' => true,
'label' => 'LLL:EXT:justo/Resources/Private/Language/locallang_db.xlf:tx_justo_domain_model_stelle.titel',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'aufgaben' => [
'exclude' => true,
'label' => 'LLL:EXT:justo/Resources/Private/Language/locallang_db.xlf:tx_justo_domain_model_stelle.aufgaben',
'config' => [
'type' => 'text',
'cols' => 40,
'rows' => 15,
'eval' => 'trim'
],
'defaultExtras' => 'richtext:rte_transform[flag=rte_enabled|mode=ts]',
],
'profil' => [
'exclude' => true,
'label' => 'LLL:EXT:justo/Resources/Private/Language/locallang_db.xlf:tx_justo_domain_model_stelle.profil',
'config' => [
'type' => 'text',
'cols' => 40,
'rows' => 15,
'eval' => 'trim',
],
'defaultExtras' => 'richtext:rte_transform[mode=ts_css]'
],
'erwartungen' => [
'exclude' => true,
'label' => 'LLL:EXT:justo/Resources/Private/Language/locallang_db.xlf:tx_justo_domain_model_stelle.erwartungen',
'config' => [
'type' => 'text',
'cols' => 40,
'rows' => 15,
'eval' => 'trim',
],
'defaultExtras' => 'richtext:rte_transform[mode=ts_css]'
],
'ort' => [
'exclude' => true,
'label' => 'LLL:EXT:justo/Resources/Private/Language/locallang_db.xlf:tx_justo_domain_model_stelle.ort',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'beginn' => [
'exclude' => true,
'label' => 'LLL:EXT:justo/Resources/Private/Language/locallang_db.xlf:tx_justo_domain_model_stelle.beginn',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'stellung' => [
'exclude' => true,
'label' => 'LLL:EXT:justo/Resources/Private/Language/locallang_db.xlf:tx_justo_domain_model_stelle.stellung',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'raum' => [
'exclude' => true,
'label' => 'LLL:EXT:justo/Resources/Private/Language/locallang_db.xlf:tx_justo_domain_model_stelle.raum',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
],
];
试试这个
'types' => [
'1' => ['showitem' => '
...,
aufgaben;;;richtext:rte_transform[mode=ts_links],
...,
'],
],
...
'columns' => [
'aufgaben' => [
'label' => 'LLL:EXT:justo/Resources/Private/Language/locallang_db.xlf:tx_justo_domain_model_stelle.aufgaben',
'config' => [
'type' => 'text',
'cols' => 80,
'rows' => 15,
'eval' => 'trim',
],
'defaultExtras' => 'richtext:rte_transform[flag=rte_enabled|mode=ts]',
],
],