I'm sure I must be missing it-- but ive been through the issues queue, readme, and code and I can't figure out how to tell tinymce about an additional plugin or how to add extended valid element, or anything else that normally goes in tinyMCE.init().

Any info would be greatly appreciated. Thanks.

Comments

sun’s picture

You did not miss something. There simply was no time for documentation yet. There is a very outdated (wrong) documentation about hook_wysiwyg_plugin() in wysiwyg.api.php that needs to be updated.

Could you elaborate a bit on what you want to achieve?

WorldFallz’s picture

Basically two things-- 1) adding the imgmap 3rd party plugin and 2) adding extended valid elements for imagemaps.

It's not urgent-- i have it working with the tinymce module. I'm just going through my d5 sites trying to prepare for the eventual upgrade to d6 and that module looks abandoned in favor of this one.

sun’s picture

Hm. The need for integrating external plugins that are not bound to Drupal modules (and effectively hosted and developed elsewhere) was already identified in #287321: Add wysiwyg_external_plugins module. Now I am unsure whether we want to move this discussion over there?

WorldFallz’s picture

Yea, it definitely seems like part of it belongs over there-- i saw that one, but for some reason i didn't think it was related, duh.

There's also the another issue of other configuration that normally goes in tinyMCE.init(). With the tinymce module, I did that by adding my own tinyMCE.init() to template.php-- unless that's still possible, in which case it's just a documentation issue (which I could help write up).

sun’s picture

The - current - plugin API allows plugins to use the 'options' key to add additional settings to the init() configuration (for TinyMCE). A few examples can be found in the editor-specfic implementation of hook_wysiwyg_plugin() in wysiwyg_tinymce_plugins() in tinymce.inc, such as:

    'advimage' => array(
      'path' => $editor['library path'] .'/plugins/advimage',
      'extensions' => array('advimage' => t('Advanced image')),
      'extended_valid_elements' => array('img[class|src|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name]'),
      'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage',
      'internal' => TRUE,
      'load' => TRUE,
    ),
    'inlinepopups' => array(
      'path' => $editor['library path'] .'/plugins/inlinepopups',
      'extensions' => array('inlinepopups' => t('Inline popups')),
      'options' => array(
        'dialog_type' => array('modal'),
      ),
      'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups',
      'internal' => TRUE,
      'load' => TRUE,
    ),

However, settings like extended_valid_elements are a bit tricky and definitely one of the major drawbacks of the current plugin API (and reason for why it needs to be rewritten). The current implementation basically allows only one extended_valid_elements definition for each tag, i.e. above definition for img would be overridden by a subsequent definition of another plugin. The same issue existed in TinyMCE module, so it might not bother you...

sun’s picture

Status: Active » Closed (duplicate)

Marking as duplicate of #287321: Add wysiwyg_external_plugins module for now.

nzcodarnoc’s picture

subscribing