Hi,

I'm working on a filter-like module that will allow users to plant show/hide tags in their text, to create a fold-out effect when parsed for display (using jQuery).

I want this module to interact with WYSIWYG, but not sure if it's possible and how to pull it off.

Any ideas, advice, or price quotes? :-)

Comments

twod’s picture

Status: Active » Postponed (maintainer needs more info)

Well, I can't really say much without knowing how your module achieves the fold-out effect. ;)
Is it ultimately inserting fieldsets and using them the way Drupal core does it. Is using something like [foldout_begin].....[foldout_end] or <!--foldout_begin-->.....<!--foldout_end--> markers when editing?

Our cross-editor API is currently too limited to handle wrapping content in such tags, it's more aimed at inserting singular markers like <!--break--> or [[uploaded_image:57]], unless you don't mind handling all selection-related things manually. I'm not saying it's impossible, just that you need to be well prepared for the task. ;)

Writing native editor plugins (one for each editor you wish to support) is of course possible, but you'll need to learn all their APIs and maintain several plugins instead of one.

The examples in wysiwyg.api.php show how to tell Wysiwyg about both native plugins and cross-editor plugins. You can look at plugins/break.inc and plugins/break/break.js for an example of how cross-editor plugins work. Writing native plugins is no different compared to when an editor is used without Wysiwyg module, except for the hook_wysiwyg_plugin() implementation needed to tell Wysiwyg about it.

twod’s picture

Status: Postponed (maintainer needs more info) » Fixed

Without more information I can't provide much more help, so I'll close this issue.
Please reopen it if you need more info.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.