• Resolved chemoul

    (@chemoul)


    Hi,
    I just sent a message to Andrew, but realised that my people might benefit by posting my question here.

    I’m trying to add an additional plugin to your fantastic TinyMCE Advanced WordPress plugin, but so far have failed.
    The plugin is quite simple and works in a stand alone TinyMCE (code below).
    I created a new folder in /plugins and uploaded the plugin files.
    I have added the plugin name to $tadv_plugins in tadv_defaults.php and included the buttons in $tadv_toolbars, $tadv_btns1 and $tadv_allbtns in the same file.
    I have copied the button images in the /images folder and added the image descriptions to the $buttons array in tadv_admin.php.

    The buttons show up on the TinyMCE Buttons Arrangement page, but not on the Add New Post page.

    What have I forgotten? Is the plugin not loading or are the buttons just not visible?
    I should also mention that my plugin file editor_plugin.js loads the button image files in the addButton function (image : ‘button.gif’,), however you seem to have extracted all image files from the standard TinyMCE plugins?

    I’ve spent the last 4 hours trying to figure this out, any help would be really appreciated.

    Thanks in advance.

    (function() {
        tinymce.create('tinymce.plugins.Speechballoons', {
            init : function(ed, url) {
                	ed.addCommand('insertyoububble', function() {
    				ed.execCommand('mceInsertContent', false, 'just some text');
    				});
    
    				ed.addCommand('insertmebubble', function() {
    				ed.execCommand('mceInsertContent', false, 'just some text');
    				});
    
    				ed.addButton('me', {
    					title : 'insertme_desc',
    					image : 'me.gif',
    					cmd : 'insertmebubble'});
    
    				ed.addButton('you', {
    					title : 'insertyou_desc',
    					image : 'you.gif',
    					cmd : 'insertyoububble'});
            },
    
            createControl : function(n, cm) {
                return null;
            },
            getInfo : function() {
                return {
                    longname : "Steve Speechballoons",
                    author : 'Steve',
                    authorurl : 'https://test.com/',
                    infourl : 'https://test.com/',
                    version : "1.0"
                };
            }
        });
        tinymce.PluginManager.add('speechballoons', tinymce.plugins.Speechballoons);
    })();
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Andrew Ozz

    (@azaozz)

    You can add an additional plugin to the Visual Editor in WordPress, look at the wp_tiny_mce() function in wp-admin/includes/post.php for the filters you can use.

    I have the same problem as chemoul but your answer Andrew is not clear.
    Maybe some things are obvious for you…
    What exactly should I do (based on chemoul’s example)?

    I had a similar problem.

    I added all my files and images to the plugins folder /mce and my button only appeared on the settings screen.

    I solved it by making little change in the tadv_admin.php

    I changed this (starting at line 153

    if ( moxiecode_plugins_url('imagemanager') ) $buttons['MCFileManager'] = 'insertimage';
    if ( moxiecode_plugins_url('filemanager') ) $buttons['MCImageManager'] = 'insertfile';

    to this

    if ( moxiecode_plugins_url('imagemanager') ) $buttons['MCImageManager'] = 'insertimage';
    if ( moxiecode_plugins_url('filemanager') ) $buttons['MCFileManager'] = 'insertfile';

    simple but effectively. Now it works fine!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘add additional plugin to TinyMCE Advanced’ is closed to new replies.