Tag Archives: tinymce

WordPress Tinymce text fields (raw HTML and JS code)

Once tinymce is loaded onto the admin page you want to work with, just use the code below to replace a textarea with the tinymce editor. Check out this blog ( http://blog.zen-dreams.com/en/2009/06/30/integrate-tinymce-into-your-wordpress-plugins/ ) for info about getting the neccessary code in the head of your page if you are not adding text boxes to the page or post sections of the admin interface. <script type="text/javascript"> /* <![CDATA[ */ jQuery(document).ready( function () { jQuery("#my_plugin_textarea").addClass("mceEditor"); if ( typeof( tinyMCE ) == "object" && typeof( tinyMCE.execCommand ) == "function" ) { tinyMCE.execCommand("mceAddControl", false, "my_plugin_textarea"); } }); /* ]]> */ </script> <textarea name="my_plugin_textarea" id="my_plugin_textarea"></textarea>

Posted in Web Development | Tagged , | 1 Comment

Installing MCImageManager on Drupal 6.12

This is a quick note on how to install MCImageManager on Drupal 6.xx in combination with TinyMCE and WYSIWYG API editor. My directory structure is as follows: sites\all\modules\wysiwyg\tinymce\jscripts\tiny_mce\plugins\imagemanager So, looking at that structure, you can see that the WYSIWYG API extension needs to be inside the modules folder. TinyMCE needs to be inside of that. And way down the line, the MCImageManager needs to be inside the plugins folder. Next, you need to edit this file: sites\all\modules\wysiwyg\editors\tinymce.inc I added the code that is in bold: ‘advimage’ => array( ‘path’ => $editor[‘library path’] .’/plugins/advimage’, ‘extensions’ => array(‘advimage’ => t(‘Advanced image’)), ‘extended_valid_elements’ => array(‘img[src|alt|title|align|width|height|hspace|vspace|border|style|class|onmouseover|onmouseout|id|name]’), ‘url’ => ‘http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage’, ‘internal’ => TRUE, ‘load’ => TRUE, ), ‘imagemanager’ => array( ‘path’ => $editor[‘library path’] .’/plugins/imagemanager’, ‘buttons’ => array(‘insertimage’ => t(‘Image Manager’)), ‘extended_valid_elements’ => array(‘img[src|alt|title|align|width|height|hspace|vspace|border|style|class|onmouseover|onmouseout|id|name]’), ‘url’ => ”, ‘internal’ => TRUE, ‘load’ => TRUE, ), ‘advlink’ => array( ‘path’ => $editor[‘library path’] .’/plugins/advlink’, ‘extensions’ => array(‘advlink’ => t(‘Advanced link’)), ‘extended_valid_elements’ => array(‘a[name|href|target|title|class|onfocus|onblur|onclick|ondlbclick|onmousedown|onmouseup|onmouseover|onmouseout|onkeypress|onkeydown|onkeyup|id|style|rel]’), ‘url’ => ‘http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink’, ‘internal’ => TRUE, ‘load’ => TRUE, ), then go into the wysiwyg api control panel in drupal, choose your input format -> Buttons and plugins and you will have an option to enable image manager. you will still need to edit the config.php inside the image manager folder to set the authentication. See this page for more details. Basically you will need to make these changes: $mcImageManagerConfig[‘authenticator’] = “ExternalAuthenticator”; $mcImageManagerConfig[‘ExternalAuthenticator.secret_key’] = “thisismysecretkey”; $mcImageManagerConfig[‘ExternalAuthenticator.external_auth_url’] = “/drupal_6_2/auth_drupal.php”; You will also need to copy the sites\all\modules \wysiwyg\tinymce\jscripts\tiny_mce \plugins\imagemanager\plugins\ExternalAuthenticator \auth_drupal.php file to the site’s doc … Continue reading

Posted in Web Development | Tagged , , | 3 Comments