富文本编辑器(RTE)提供了使用标记输入文本的功能。
对于社区组件,虽然与创作环境🔗中的富文本编辑器类似,但它会影响在发布环境中输入的文本。
可以启用允许用户生成内容(UGC)的社区组件来允许RTE。 根据组件是添加到页面还是包含在函数中,RTE默认可能是未启用的。
如果未启用,则只需进入作者编辑模式,选择要编辑的组件,然后选中Rich Text Editor
复选框。
RTE可用于以下社区组件:
可以自定义富文本编辑器,因为该实现基于CKEditor。
Communities组件的当前配置位于cq.social. scf clientlib
中,位于
/libs/clientlibs/social/commons/scf/ckrte.js
不建议修改cq.social.scf clientlib,因为以后的升级可能会覆盖任何编辑。
出于安全考虑,默认情况下,超链接选项不会包含在呈现给成员的富文本图标集中。 在UGC中允许href时,故障诊断能力较强。
要将超链接选项添加到工具栏,请执行以下操作:
links
”的工具栏
{ name: 'links', items: [ 'Link','Unlink','Anchor' ] }
CKRte.prototype.config = {
toolbar: [
{ name: "basicstyles",
items: ["Bold", "Italic", "Underline", "NumberedList", "BulletedList", "Outdent", "Indent", "JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyBlock", "TextColor"]
},
{ name: 'links',
items: [ 'Link','Unlink','Anchor' ]
}
],
autoParagraph: false,
autoUpdateElement: false,
removePlugins: "elementspath",
resize_enabled: false
};