Media Button in WYSIWYG Module
We’re implementing the new WYSIWYG Module in Drupal 6, and really digging it. We are using it with our WYSIWYG Editor of choice: TinyMCE (3.2.1.1).
We noticed, however, as we were setting up the module in Drupal, that our beloved media button was gone. Here’s how we got it back in there:
First, you need to install and setup the module & tinyMCE as detailed in the readme file. Next, open ‘…modules\wysiwyg\editors\tinymce.inc’
All you have to do is add a few lines of code (around line 472):
‘layer’ => array(
‘path’ => $editor['library path'] .’/plugins/layer’,
‘buttons’ => array(’insertlayer’ => t(’Insert layer’), ‘moveforward’ => t(’Move forward’), ‘movebackward’ => t(’Move backward’), ‘absolute’ => t(’Absolute’)),
‘url’ => ‘http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer’,
‘internal’ => TRUE,
‘load’ => TRUE,
),/*Begin Inserted Lines*/
‘media’ => array(
‘path’ => $editor['library path'] .’/plugins/meda’,
‘buttons’ => array(’media’ => t(’Insert Media’)),
‘url’ => ‘http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media’,
‘internal’ => TRUE,
‘load’ => TRUE,
),/*End Inserted Lines*/
‘paste’ => array(
‘path’ => $editor['library path'] .’/plugins/paste’,
‘buttons’ => array(’pastetext’ => t(’Paste text’), ‘pasteword’ => t(’Paste from Word’), ’selectall’ => t(’Select all’)),
‘url’ => ‘http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste’,
‘internal’ => TRUE,
‘load’ => TRUE,
),
Now the media button will be available to be selected as an option from your TinyMCE administrator page within drupal.

Thank you for these instructions for the media button but…
I followed the instructions for adding the media button, but after adding the lines to tinymce.inc, as instructed (and correcting the typo and changing:
‘path’ => $editor['library path'] .’/plugins/meda’,
to
‘path’ => $editor['library path'] .’/plugins/media’,
then when I reload the /wysiwyg/profile page, I just get a blank page. A soon as I delete these lines from the INC file, the profile page comes back.
I cleared the cache and reloaded many times, still with the same results in both Firefox and MSIE.
What is going on??
Comment by Norm Strassner — February 12, 2009 @ 1:34 pm
woohoo! awesome! it works! now tinymce can handle media inline and i don’t have to create a custom CCK field. a much more streamlined and user friendly approach. thank you so much for posting!
Comment by drew — August 28, 2009 @ 3:36 pm