新增資產類型大量文字欄位並將外觀設為 RTF 編輯器之後,便可以建立自訂工具列。
工具列會預先填入標準工具列群組和選項,而且您會見到其預覽。
若要自訂工具列,請按一下 JSON 頁籤,然後使用 CKEditor 語法編輯 JSON 組態。請參閱 https://ckeditor.com/latest/samples/toolbarconfigurator/index.html#basic。
大量文字欄位支援下列群組:
"basicstyles" - 限制為粗體/斜體/底線 https://ckeditor.com/cke4/addon/basicstyles
"styles" - 字型樣式 https://docs.ckeditor.com/ckeditor4/latest/guide/dev_styles.html
"colors" - 文字和背景色彩 https://docs.ckeditor.com/ckeditor4/latest/guide/dev_colorbutton.html
"undo" - 還原/重做編輯器中目前的執行處理
"links" - 連結自訂 Plugin 對話方塊
"paragraph" - 項目符號/編號清單與縮排支援
"list"
"indent"
"align" - 靠左/靠右/置中
"insert"
"image"
"table"
"cleanup" - 移除所選文字的全部樣式
此外,還可以使用資料列區隔符號項目:"/"
註:
若您在工具列群組組態中設定任何其他值,該值會在「網站產生器」工具列建立之前先被移除。您不能提供 "extraPlugins"。僅支援 "name"/"groups" 組態。所有 "items" 項目都會被忽略。您可以使用 "toolbarGroups" 和 "removeButtons" 或 "toolbar" 作為特性。請參閱下方範例。
範例 2-1 選項 1:"toolbarGroups" 和 "removeButtons"
{ "toolbarGroups": [ {"name": "basicstyles"} , {"name": "styles"} , {"name": "colors"} , {"name": "clipboard"} , "/", {"name": "links"} , {"name": "insert"} , {"name": "paragraph","groups": ["list","indent"]} , {"name": "align"} , {"name": "undo"} , {"name": "cleanup"} , {"name": "mode"} , {"name": "tools"} ], "removeButtons": "Styles,Subscript,Superscript,Anchor,Blockquote,PasteFromWord,Copy,Cut" }
範例 2-2 選項 2:"toolbar"
{ "toolbar" = [ { "name":"basicstyles","items":["Bold","Italic","Underline","Strike","Subscript","Superscript","-","CopyFormatting","RemoveFormat"] } , { "name":"paragraph","items":["NumberedList","BulletedList","-","Outdent","Indent","-","Blockquote","CreateDiv","-","JustifyLeft","JustifyCenter","JustifyRight","JustifyBlock","-","BidiLtr","BidiRtl","Language"] } , { "name":"links","items":["Link","Unlink","Anchor"] } , { "name":"insert","items":["Image","Flash","Table","HorizontalRule","Smiley","SpecialChar","PageBreak","Iframe"] } , "/", { "name":"styles","items":["Styles","Format","Font","FontSize"] } , { "name":"colors","items":["TextColor","BGColor"] } , { "name":"tools","items":["Maximize","ShowBlocks"] } , { "name":"about","items":["About"] } ]}