2013-10-16 56 views
2

我可以使用頁面標記中的ToolbarBasic屬性爲asp.net中的ckeditor控件定義自定義工具欄。我不喜歡這樣寫道:如何在頁面標記中定義自定義ckeditor工具欄

<CKEditor:CKEditorControl ID="CKEditor1" BasePath="/ckeditor/" runat="server" Width="100%" Toolbar="Basic" 
ToolbarBasic="|Bold|Italic|Underline|Strike|-|NumberedList|BulletedList|Outdent|Indent|-|JustifyLeft|JustifyCenter|JustifyRight|JustifyBlock|-|Link|Unlink|-|TextColor|-|Undo|Redo|Cut|Copy|Paste|PasteText|PasteFromWord|-|Find|Replace|SelectAll|-|Image|Table|HorizontalRule|SpecialChar|-|Format|" ></CKEditor:CKEditorControl> 

這將創建與所有相同的「節」,即他們是那種組合在一起內的指定項目的自定義工具欄。凡| | |指定時,這會在項目之間創建一條小垂直線,但項目保留在同一個「部分」中。我可以看到,當使用標準的「完整」工具欄時,項目被分割成多個部分,但我不確定如何使用上述語法來完成此操作。

不幸的是,我不記得我最初在網上找到這個語法的地方,並且從我的一箇舊項目中獲得了它。現在我無法在線查找關於此語法的任何信息,並且所有搜索都以不同方式提供了有關定義自定義工具欄的信息。

我使用的ckeditor版本是3.6.6.1。

回答

5

你可能發現,原來這裏的語法:http://docs.cksource.com/CKEditor_3.x/Developers_Guide/ASP.NET/Configuration

要回答你的問題,一個新的行創建一個新的部分和/把下一行的按鈕。

使用您的示例:

<CKEditor:CKEditorControl ID="CKEditor1" BasePath="/ckeditor/" runat="server" Width="100%" Toolbar="Basic" 
ToolbarBasic="|Bold|Italic|Underline|Strike|-|NumberedList|BulletedList|Outdent|Indent|-|JustifyLeft|JustifyCenter|JustifyRight|JustifyBlock| 
|Link|Unlink|-|TextColor|-|Undo|Redo|Cut|Copy|Paste|PasteText|PasteFromWord| 
/
|Find|Replace|SelectAll|-|Image|Table|HorizontalRule|SpecialChar|-|Format|" ></CKEditor:CKEditorControl> 

這將添加一個部分間隙JustifyBlockLink之間,以及後PasteFromWord到第二行轉移的按鈕。

如果需要,您也可以廢除ToolbarBasic中的文字設置,並直接在Toolbar屬性中設置該文字。

0

CKEditor工具欄可根據您的需要進行調整。您可以定義一個包含所有在Full工具欄定義可用的按鈕使用下面的代碼工具欄:

        <CKEditor:CKEditorControl ID="CKEdMainPageDescriptionWebsiteMobileappEn" BasePath="ckeditor/" runat="server" Width="100%" Toolbar="Basic" 
             ToolbarBasic="|Bold|Italic|Underline|Strike|-|NumberedList|BulletedList|Outdent|Indent|-|JustifyLeft|JustifyCenter|JustifyRight|JustifyBlock| 
             |Link|Unlink|-|TextColor|-|Undo|Redo|Cut|Copy|Paste|PasteText|PasteFromWord| 
             /
             |Styles|-|Format|-|Font|-|FontSize|"> </CKEditor:CKEditorControl> 

http://thecallingtree.com/ToolbarDefine.aspx