Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CKEditor: Button is not appearing

Tags:

ckeditor

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.

like image 472
Rabeel Avatar asked Dec 06 '12 03:12

Rabeel


People also ask

How do I enable source in CKEditor?

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.

How do you add a toolbar to CKEditor?

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.

Is CKEditor a WYSIWYG?

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.


1 Answers

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.

like image 137
r3mark Avatar answered Oct 16 '22 05:10

r3mark