富格文本編輯器(RTE)提供了輸入帶有標注的文本的功能。
對於Communities元件,雖然與作者環境](…/…/help/sites-authoring/rich-text-editor.md)中的[rich text編輯器類似,但會影響在發佈環境中輸入的文字。
允許用戶生成內容(UGC)的社群元件可以啟用允許RTE。 根據元件是添加到頁面還是包含在函式中,RTE預設情況下可能啟用或禁用。
如果未啟用,只需輸入作者編輯模式,選擇要編輯的元件,然後選擇Rich Text Editor
複選框。
RTE可用於以下Communities元件:
由於實現基於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
};