WordPress.org

Ready to get started?Download WordPress

Forums

TinyMCE Advanced
[resolved] add additional plugin to TinyMCE Advanced (4 posts)

  1. chemoul
    Member
    Posted 3 years ago #

    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 : 'http://test.com/',
                    infourl : 'http://test.com/',
                    version : "1.0"
                };
            }
        });
        tinymce.PluginManager.add('speechballoons', tinymce.plugins.Speechballoons);
    })();
  2. Andrew Ozz
    WordPress Dev
    Plugin Author

    Posted 3 years ago #

    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.

  3. errorsys
    Member
    Posted 3 years ago #

    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)?

  4. Carsten Bach
    Member
    Posted 2 years ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic