My favorites | Sign in
Project Logo
                
Search
for
Updated Oct 31, 2008 by adam.maschek
Labels: Phase-Deploy, Featured
TinyMCE_setup  
How to setup the TinyMCE plugin.

TinyMCE 2.x and 3.x

  1. for TinyMCE 2.x copy files from plugin_tinymce{x}.zip to {yourtinyinstance}/plugins/imgmap/
  2. for TinyMCE 3.x copy files from plugin_tinymce3.{x}.zip to {yourtinyinstance}/plugins/imgmap/
  3. set up your instance in the tinyMCE.init() method to use the plugin, like:
  4. plugins : "table,save,advhr,advimage,imgmap,...",
  5. set up your instance to use the imgmap button, for example:
  6. theme_advanced_buttons3_add : "emotions,iespell,...,imgmap",
  7. you will most likely need to add:
  8. extended_valid_elements: "img[usemap|class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],map[id|name],area[shape|alt|coords|href|target]",

Notes:


Comment by cocoavillage, Nov 21, 2008

I got it to work with drupal 5.12 and tinymce 3.x

More notes at http://drupal.org/node/195498#comment-1120143

Comment by cocoavillage, Jan 27, 2009

For drupal users, if you did not know this already... the tinymce module is deprecated by the wysiwyg module.

I was able to get the imgmap plugin to work for that module it seems...

After putting the proper unzip in the proper tinymce folder, had to edit sites/all/modules/wysiwyg/editors/tinymce.inc instead of the old plugin_reg.php

<code> // added after table plugin array description for img support // pep, http://code.google.com/p/imgmap/wiki/TinyMCE_setup 'imgmap' => array( 'path' => $editorpath'? .'/plugins/imgmap', 'buttons' => array('imgmap' => t('Image Map')), 'extended_valid_elements' => array('img[usemap|class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseove r|onmouseout|name],map[id|name],area[shape|alt|coords|href|target]'), 'url' => 'http://code.google.com/p/imgmap/', 'internal' => TRUE, 'load' => TRUE, ), // end mod for imgmap </code>

Comment by the.david.dickens, Apr 03, 2009

I am using the wysiwyg module as well, with TinyMCE 3.2.2 and the imgmap showed up on my button...and appeared to work, but I could not get it to place the <code><img usemap="#somemapid" src="/files/somepicture.gif" border="0" width="400" height="300" /></code> in the html.

I had to add the "usemap" parameter to my advimage img array. Like so: <code>'extended_valid_elements' => array('img[usemap|src|alt|title|align|width|height|hspace|vspace|border|style|class|onmouseover|onmouseout|id|name]'), </code>

I also added onmouseover|onmouseout|title parameters to the area attribute as well.

This worked like gangbusters.

Comment by daveottocomplex, Jul 18, 2009

Awesome piece of work!! Are many people using in in tinyMCE?

The only difference between plugin_tinymce96.zip and plugin_tinymce3.96.zip is the install.txt file. I tried using on tinymce ver 3.5.2 and needed the following changes:

1) popup.html::delayedLoad(): always using tinyMCEPopup.onInit.add(init()); 2) editor_plugin.js: passing img_obj via additional parameters (not working in function.js::init() function was getting a form element instead of selected img (didn't try to figure why) 3) functions.js:init():: get img_obj from tinyMCEPopup.getWindowArg('img_obj') 4) imgmap.js: Firefox objects this.areasid?.label & this.areasid?.parentNode undefined so not set to null when they don't exist 5) instructions fieldset added and some css tweaks

Comment by tacticalcorsets, Nov 28, 2009

Thanks for these detailed code examples.

Comment by tacticalcorsets, Nov 28, 2009

All I had to do was put the imgmap folder from the zip file into the /sites/all/libraries/tinymce/jscripts/tiny_mce/plugins directory. Then I applied the code snippets above. I had to find where to insert them, so here's a clearer explanation:

In the interest of combining the already awesome code snippets you've provided, here's my combined hack that works like a charm for drupal/sites/all/modules/wysiwyg/editors/tinymce.inc:

1. Find the array that starts with $plugins = array( 2. Apply this hack starting with replacing 'advimage' => array(

<code> 'advimage' => array( 'path' => $editorpath'? . '/plugins/advimage', 'extensions' => array('advimage' => t('Advanced image')), // hack for imgmap added usemap to this list 'extended_valid_elements' => array('img[usemap|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, ), // hack for imgmap // added after table plugin array description for img support // pep, http://code.google.com/p/imgmap/wiki/TinyMCE_setup 'imgmap' => array( 'path' => $editorpath'? .'/plugins/imgmap', 'buttons' => array('imgmap' => t('Image Map')), 'extended_valid_elements' => array('img[usemap|class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseove r|onmouseout|name],map[id|name],area[onmouseover|onmouseout|title|shape|alt|coords|href|target]'), 'url' => 'http://code.google.com/p/imgmap/', 'internal' => TRUE, 'load' => TRUE, ), // end mod for imgmap </code>


Sign in to add a comment
Hosted by Google Code