我的扩展中的rte
有一些问题。在表格中,我设置了字段text area with rte
。在 BE TYPO3 生成 rte 视图中,当我格式化文本时,一切都很好。唯一的问题是当我有一些段落时 - 在 BE 中我有<p>
标签,但在 HTML 代码的前端,<p>
标签"不存在"。
我的 TCA 代码如下所示:
'description' => array(
'exclude' => 1,
'label' => 'LLL:EXT:fu_product_table/locallang_db.xml:tx_table_products.description',
'defaultExtras' => 'richtext[*]',
'config' => array(
'type' => 'text',
'cols' => '30',
'rows' => '5',
'wizards' => array(
'_PADDING' => 2,
'RTE' => array(
'notNewRecords' => 1,
'RTEonly' => 1,
'type' => 'script',
'title' => 'Full screen Rich Text Editing|Formatteret redigering i hele vinduet',
'icon' => 'wizard_rte2.gif',
'script' => 'wizard_rte.php',
),
),
)
),
然后尝试在类中呈现字段:
'<td class="td-1">' . $this->getFieldContent('description') . '</td>';
有什么建议吗?
TYPO3 将 RTE 的内容保存得有点"修剪"(没有完整标记),因此要将其"恢复"为有效的 HTML,您需要使用专用方法包装它,即:
$this->pi_RTEcssText($this->getFieldContent('description'))
注意:Adrian,Extbase的下一点:它有特殊的视图助手,所以你可以直接在模板中轻松完成;)