3

I'm able to define a custom toolbar for a ckeditor control in asp.net using just the ToolbarBasic property within the page markup. I do it like this:

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

This creates a custom toolbar with all of the specified items within the same "section" i.e. they are sort of grouped together. Where a |-| is specified, this creates a small vertical line between the items but the items remain in the same "section". I can see that when using the standard "Full" toolbar, the items are split into multiple sections but I'm not sure how to do that using the above syntax.

Unfortunately I don't remember where I originally found this syntax online and have taken it from an old project of mine. Now I cant find any information about this syntax online and all searches give information about defining a custom toolbar in different ways.

The version of ckeditor I'm using is 3.6.6.1.

4

3 回答 3

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>

JustifyBlock这将在和之间添加一个截面间隙,并将Link按钮移到 之后的第二行PasteFromWord

如果需要,您也可以取消设置该文本ToolbarBasic并直接在Toolbar属性中设置它。

于 2014-02-21T04:01:56.390 回答
0

我更喜欢在它所说的地方进行编辑:\Scripts\ckeditor\config.js

/*
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/

CKEDITOR.editorConfig = function( config )
{
	// Define changes to default configuration here. For example:
	// config.language = 'fr';
	// config.uiColor = '#AADC6E';
    config.removePlugins = 'save';
};

于 2018-06-21T18:54:26.633 回答
0

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

                                    <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

于 2015-10-12T08:05:35.607 回答