Creating Custom Buttons

Plug-ins enable you to add custom buttons to the rich text editor toolbar.

To create custom buttons:

  1. Create a new HTML definition and save it with the prefix PT_RTE_PLUGIN_, for example, PT_RTE_PLUGIN_MYPLUGIN.

  2. Use JavaScript to code the functionality of the button in the HTML definition. This is sample code for a button that will create a new page:

    CKEDITOR.plugins.add( 'TestPlugin',
    {
    init : function( editor )
    {
    
    editor.addCommand( 'Oracle_New_Page',
    {
    modes : { wysiwyg:1, source:1 },
    
    exec : function( editor )
    {
    editor.setData( editor.config.newpage_html );
    editor.focus();
    }
    });
    var iconpath= CKEDITOR.getUrl('skins/' + editor.config.skin + '/icons.png'
    );
    editor.ui.addButton( 'TestPlugin',
    {
    label : ?'Oracle_New_Page'?,
    command : ''Oracle_New_Page'',
    icon: iconpath,
    iconOffset : 0
    });
    }
    });