0
如果有強制Magnolia所見即所得編輯器在粗體/斜體/下劃線之前顯示帶有「標題1」,「標題2」等選擇框的網站範圍內的方法鈕釦?在Magnolia所見即所得編輯器中默認顯示H1
如果有強制Magnolia所見即所得編輯器在粗體/斜體/下劃線之前顯示帶有「標題1」,「標題2」等選擇框的網站範圍內的方法鈕釦?在Magnolia所見即所得編輯器中默認顯示H1
首先,我在服務中創建了這個輔助方法。
public RichTextFieldBuilder extendRichText(RichTextFieldBuilder richTextFieldBuilder) {
RichTextFieldDefinition richTextFieldDefinition = richTextFieldBuilder.definition();
richTextFieldDefinition.setConfigJsFile("/.resources/ckeditor/config.js");
richTextFieldBuilder.images(true);
return richTextFieldBuilder;
}
然後創建這個文件:/.resources/ckeditor/config.js
CKEDITOR.editorConfig = function(config) {
config.toolbar = "Magnolia";
config.toolbar_Magnolia = [
{ name: "styles", items: [ "Format", "FontSize", "TextColor" ] },
{ name: "styles", items: [ "Bold", "Italic", "Underline", "SpecialChar" ] },
{ name: "paragraph", items: [ "NumberedList", "BulletedList", "PasteFromWord" ] },
{ name: "objects", items: [ "Image" ] },
{ name: "links", items: [ "Link", "InternalLink", "DamLink", "Unlink" ] }
];
};
您可能還需要爲CKEditor的格式插件。