2013-10-16 57 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