RTF編輯器(RTE)提供使用標籤輸入文本的功能。
針對Communities元件,雖然類似於製作環境🔗中的 RTF編輯器,但會影響在發佈環境中輸入的文字。
允許使用者產生內容(UGC)的社群元件可啟用以允許RTE。 視元件是否已新增至頁面或包含在函式中而定,RTE可能預設為啟用或不啟用。
如果未啟用,只需輸入作者編輯模式,選擇要編輯的元件,然後選擇Rich Text Editor
複選框。
RTE適用於下列Communities元件:
RTF編輯器可自訂,因為實作是以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
};