January 27, 2009

Media Button in WYSIWYG Module

Filed under: Drupal, PHP — admin @ 11:17 am

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.

Who we are

Explore our history and character.

If you've ever been on a blind-date, odds are great that you know how disastrous "jumping before looking" can be. Feel free to do some online stalking here before you contact Soleer.

What We Do

"Girls only want boyfriends who have great skills." -Napoleon Dynamite

While we aren't looking to be your boyfriend and might not have "nunchuku skills," we do offer a number of other services and solutions to assist your organization.

What We’ve Done

As we say in Texas, "This ain't our first rodeo." Take a look at a sampling of some of our masterpieces, from logo design and brochure creation to webpage design and online community development.