PDA

View Full Version : How to change button placement in message toolbars


msmayz
06-09-2014, 04:46 PM
Hey guys. How do I change the placement of the buttons in the message toolbars? I recently added a strikethrough button, but it appears at the end of the toolbar. I would like to move it so that it's located in the text emphasis group with the bold, italic, and underline buttons.

Thanks!

msmayz
06-11-2014, 05:03 AM
Bumpity bump. I'd still like to move the new strikethrough button so that it's adjacent to the bold/italics/underline buttons in the toolbar. Any ideas? Anyone?

tbworld
06-11-2014, 08:32 AM
Since you already have your plugin working:

The easiest way to do this is to edit the file "/vb/ckeditor.php". Find the class::method "SetToolbar" (around line #258) and add your ckeditor plugin reference directly to the toolbars. You can easily rearrange the toolbars in this class::method.

If you need to do this via a plugin you can recreate/rearrange the toolbar arrays and use the hook: 'editor_toolbar_set'.

Example: (for "/vb/ckeditor.php").

// Hopefully, I did not over simplify.

$toolbar[] = array('Bold', 'Italic', 'Underline'); //original
$toolbar[] = array('Bold', 'MyCustomPlugin', 'Italic', ' Underline'); // new - positioned



Sincere thanks for all the 'pioneers' that indirectly (years ago) took the time to point me in the right direction via your articles and posts. You guys/gals never get praised enough: @Cellarius, @Nerbert, @Lynne, @Kh99. If I missed anyone I apologize.

msmayz
06-15-2014, 06:20 AM
Thanks, tbworld! That worked perfectly.

My only issue now is that the new BBCode button appears in both places: with the bold/italics/underline group (which is what I wanted, yay!), and at the very end of the last toolbar. How do I remove it from the latter location?