[Product-Developers] Loading tinymce in an overlay

Andrew Pasquale andrew at elytra.net
Thu Aug 4 17:22:01 UTC 2011


Hi.  I am trying to allow users to add content from overlays and allow
rich text editing using tinymce from the overlay.  This is similar to
the interface used in the new plone.app.cmsui product, which is
terrific, by the way.

I'm using $('.overlay a').prepOverlay({...}) to load the plone url
into an overlay.  This works fine.

I'm initializing the tinymce in the overlay like this:

$(document).bind('loadInsideOverlay', function() {
    $('textarea.mce_editable').each(function() {
        var config = new TinyMCEConfig($(this).attr('id'));
        config.init();
    });
});

When I try to add a "News Item", tinymce inits the way I'd expect.
http://localhost:8080/Plone/createObject?type_name=News+Item

But adding a dexterity content type doesn't work.
http://localhost:8080/Plone/++add++my.product.type

The overlay loads fine without the 'loadInsideOverlay' trigger.  I
haven't had much luck debugging this one.  The proper element seems to
be selected using the jQuery selector.
The chrome js debugger tells me there's an "Uncaught SyntaxError:
Unexpected token )", but nothing else useful.

This might be unrelated, but tinymce in the overlayed "News Item"
loads the first time the overlay is triggered.  Subsequent loads don't
initialize the editor.

Thanks for any thoughts,
Andrew


More information about the Product-Developers mailing list