R
ragtek
Guest
In this tutorial you'll see how you can extend/customize the xenforo editor.
In my plugin, i've added a button, which is opening a div container under the editor
(Demo Video: http://ragtek.org/videos/editortemplates.htm )
As first, you need to create a folder with your tinyMCE plugin and place it in /js/tinymce/plugins/
In my case it's
More infos can be found here => http://www.tinymce.com
2. create a template hook event listener, to add the necessary changes to the template.
In line 3 i'm adding my "editortemplate" to the xenforo default plugins.
In line 7 i'm replacing the toolbar buttons with my own version => i've added 2 seperators | and my editortemplate button
That's it
If you now load the editor, you'll see your new button.
(Attention: with this way, ONLY 1 PLUGIN will be able to add own buttons)
I wish there was a easier way for this in vBulletin it's much easier
(Will be continued)
Demo: www.ragtek.org/xenforo
In my plugin, i've added a button, which is opening a div container under the editor
(Demo Video: http://ragtek.org/videos/editortemplates.htm )
As first, you need to create a folder with your tinyMCE plugin and place it in /js/tinymce/plugins/
In my case it's
More infos can be found here => http://www.tinymce.com
2. create a template hook event listener, to add the necessary changes to the template.
PHP:
case 'editor_js_setup':
$search = "var plugins = '";
$replace = "var plugins = 'editortemplate,";
$contents = str_replace($search, $replace, $contents);
break;
case 'editor_tinymce_init':
$addToTemplate = ",\ntheme_xenforo_buttons2 : 'bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,|,bullist,numlist,outdent,indent,|,link,unlink,image,xenforo_media,xenforo_custom_bbcode,|,xenforo_code,|,|,editortemplate'";
$contents = $contents . $addToTemplate;
break;
In line 3 i'm adding my "editortemplate" to the xenforo default plugins.
In line 7 i'm replacing the toolbar buttons with my own version => i've added 2 seperators | and my editortemplate button
That's it
If you now load the editor, you'll see your new button.
(Attention: with this way, ONLY 1 PLUGIN will be able to add own buttons)
I wish there was a easier way for this in vBulletin it's much easier
(Will be continued)
Demo: www.ragtek.org/xenforo