Asp.net 如何在页面标记中定义自定义编辑器工具栏

Asp.net 如何在页面标记中定义自定义编辑器工具栏,asp.net,webforms,ckeditor,Asp.net,Webforms,Ckeditor,我可以使用页面标记中的ToolbarBasic属性为asp.net中的ckeditor控件定义自定义工具栏。我是这样做的: <CKEditor:CKEditorControl ID="CKEditor1" BasePath="/ckeditor/" runat="server" Width="100%" Toolbar="Basic" ToolbarBasic="|Bold|Italic|Underline|Strike|-|NumberedList|BulletedList|Outden

我可以使用页面标记中的ToolbarBasic属性为asp.net中的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。

您可能在这里找到了原始语法:

要回答您的问题,新行将创建一个新部分,并将按钮置于下一行

以您的例子:

<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>

这将在
JustifyBlock
Link
之间添加一个节间距,并将按钮移动到
粘贴fromWord
后的第二行


您也可以不用在
ToolbarBasic
中设置该文本,只要在
Toolbar
属性中直接设置即可。

CKEditor Toolbar可以根据需要进行调整。可以使用以下代码定义包含完整工具栏定义中所有可用按钮的工具栏:

                                    <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>


我更喜欢在此处编辑:\Scripts\ckeditor\config.js

/*
版权所有(c)2003-2012,CKSource-Frederico Knabben。版权所有。
有关许可,请参阅LICENSE.html或http://ckeditor.com/license
*/
CKEDITOR.editorConfig=函数(配置)
{
//在此处定义对默认配置的更改。例如:
//config.language='fr';
//config.uiColor='#AADC6E';
config.removePlugins='save';
};