By abhishek |

UPDATE: This post is quite old now and wont work with the latest version of WYSIWYG API, will try to update this soon.

Gallery2 is one of the best galleries available which could be integrated with Drupal easily you would have read my post on integrating it earlier, after you have integrated it the bigger question is how get those images into your content or nodes so this posts answers it, after reading this post you would be able to integrate Gallery2 with your WYSIWYG (TinyMCE) Editor.


The Steps

  1. Extract G2 Image Application in $DRUPAL_HOME/sites/all/modules/wysiwyg/tinymce/jscripts/tiny_mce/plugins/
  2. Open Gallery Setting in Web Browser from $SITENAME/admin/settings/gallery/g2image and enable G2Image for TimyMCE as shown in the image below
    gallery settings
  3. Once you have selected the Mode as TinyMCE add the following code in %drupal%sites/all/modules/wysiwyg/editors/ (function wysiwyg_tinymce_plugins($editor))

    'G2Image' => array(
            'path' => $editor['library path'] .'/plugins/G2Image',
            'buttons' => array('G2Image' => t('G2Image')),
            'internal' => TRUE,
            'load' => TRUE,

  4. Now enable G2Image button for TinyMCE from the editor profile at "admin/settings/wysiwyg/profile/edit/2"
  5. Thats it select G2Image button in TinyMCE

    it will popup a Galley as shown below for you to select images and insert them directly in your posts :)

    gallery Pop Up

Vincent (not verified)

14 years 5 months ago

first thanks for your article: it help a lot to setup all the thing !

In my case I had to change:
'path' => $editor['library path'] .'/plugins/G2Image',
'path' => $editor['library path'] .'/plugins/g2image',

I still have an issue:
when I selected G2Image in the Button and plugins list, TinyMCE doesn't appear anymore ...

any idea?

thanks in advance


my config:

Gallery 2.3
Drupal 6.10
Gallery 6.x-1.0
Wysiwyg 6.x-2.x-dev
TinyMCE 3.2.3
IMCE 6.x-1.2
IMCE Wysiwyg API bridge 6.x-1.0

Same Problem for me with Wysiwyg 6.x-2.0. If I activate the G2Image-Button, TinyMCE doesn't appear any more at all! Anyone who has solved this problem yet?

"The article you have posted is superb!

There are so many informative information. This is very knowledgeable article.

Thank you!"