mediaweb / silverstripe-tinymce4
此包已被 废弃 并不再维护。未建议替代包。
用 TinyMCE v4 替换默认的 Silverstripe HTMLEditor (TinyMCE v3)。
1.1.8
2018-02-13 09:57 UTC
Requires
- silverstripe/cms: ~3.2
- silverstripe/framework: ~3.2
README
用 TinyMCE v4 替换默认的 Silverstripe HTMLEditor (TinyMCE v3)。
用法
- HtmlEditorConfig 被CustomHtmlEditorConfig 替换
- HtmlEditorField 被CustomHtmlEditorField 替换
当使用此模块时请注意:使用 HTMLEditorField 可能会破坏管理界面。请将所有实例替换为 CustomHTMLEditorField。
有两种用法
- 使用自动脚手架(scaffoldFormField)
private static $db = array(
'CustomContent' => 'CustomHTMLText'
)
- 使用 updateCMSFields 或 getCMSFields
public function getCMSFields() {
$fields = parent::getCMSFields();
$fields->insertAfter(
CustomHTMLEditorField::create('CustomContent', 'Custom Content')->addExtraClass('stacked'),
'Content'
);
return $fields;
}
注意:确保允许访问 'thirdparty/tinymce/tiny_mce_gzip.php';已添加 .htaccess 文件,当使用 Nginx 时需要一些额外的配置。