Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
My custom plugin appears at admin/config/content/ckeditor/edit/Full but not at the node edit mode.
Here is my module:
function ion_plugin_ckeditor_plugin() {
return array(
'blauer_infoknopf' => array(
// Plugin name.
'name' => 'blauer_infoknopf',
// Plugin description - it will be displayed in the plugins management section of the profile settings.
'desc' => t('Ein blau hinterlegter Knopf'),
// The full path to the CKEditor plugin directory, trailing slash included.
'path' => drupal_get_path('module', 'ion_plugin') . '/plugins/',
// Plugin buttons definition (optional).
'buttons' => array(
'blauer_infoknopf' => array('label' => 'Blauer Infoknopf', 'icon' => 'images/farbe-blau-ipad-wallpaper.jpg'),
)
)
);
}
And here is the plugin:
(function($) {
CKEDITOR.plugins.add( 'blauer_infoknopf', {
init: function( editor )
{
editor.addCommand( 'blauer_infoknopf_command', {
exec : function( editor ) {
//here is where we tell CKEditor what to do.
editor.insertHtml( 'Test' );
}
});
editor.ui.addButton( 'blauer_infoknopf', {
label: 'Test-Text', //this is the tooltip text for the button
command: 'blauer_infoknopf_command',
icon: this.path + 'images/farbe-blau-ipad-wallpaper.jpg'
});
}
});
})(jQuery);
The file structure:
.../sites/all/modules/ion_plugin/ion_plugin.module
.../sites/all/modules/ion_plugin/plugins/plugin.js
Comments
Comment #2
iKb CreditAttribution: iKb commentedSame here. Button do not appears when editing the node.
Comment #3
luizsgpetri CreditAttribution: luizsgpetri at CI&T for Pfizer, Inc. commentedSame