I want to add a button in toolbar of CKEditor but button is not appearing.This is code for creation of plugin saved in _source/plugins/footnote/
CKEDITOR.plugins.add('footnote',
{
init: function(editor)
{
var pluginName = 'footnote';
CKEDITOR.dialog.add(pluginName, this.path + 'dialogs/footnote.js');
editor.addCommand(pluginName, new CKEDITOR.dialogCommand(pluginName));
editor.ui.addButton('Footnote',
{
label: 'Footnote or Citation',
command: pluginName
});
}
});
And this is code of config.js
CKEDITOR.editorConfig = function( config )
{
config.toolbar = 'MyToolbar';
config.extraPlugins = 'footnote';
config.toolbar_MyToolbar =
[
['Bold','Footnote','Italic']
];
};
Just bold and italic are appearing in toolbar.But footnote button is not appearing. Thanks for your help.
Classic Editor with Default Source Editing AreaClick the Source button to display the HTML source of this text in the source editing area. Click the Source button again to return to the WYSIWYG view.
The simplest way to configure the toolbar is to use the dedicated toolbar configurator that is available in each editor installation package starting from CKEditor 4.5. The editor instance below was configured by using the accessible "toolbar groups" approach, with some unwanted buttons removed by setting the config.
CKEditor is a WYSIWYG HTML editor that can fit a wide range of use cases: from Word-like documents with large toolbars to simple toolbars with a limited set of features used for emails or instant messaging.
You are not providing an icon:
CKEDITOR.plugins.add('footnote',
{
icons: 'myfootnote',
init: function (editor) {
var pluginName = 'footnote';
CKEDITOR.dialog.add(pluginName, this.path + 'dialogs/footnote.js');
editor.addCommand(pluginName, new CKEDITOR.dialogCommand(pluginName));
editor.ui.addButton('Footnote',
{
label: 'Footnote or Citation',
icon: 'myfootnote',
command: pluginName
});
}
});
Be sure to create an icon at /plugins/footnote/icons/myfootnote.png.
Only PNGs are accepted.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With