TinyMCE event plugin workaround for blockquote

Creating and modifying plugins.
Post Reply
akremedy
Regular
Posts: 56
Joined: Sat Jul 26, 2008 9:06 am
Location: Bay Area, U.S.A.
Contact:

TinyMCE event plugin workaround for blockquote

Post by akremedy »

Apologies if this has been discussed already or is documented somewhere...

I've just implemented TinyMCE as my wysiwyg editor in lieu of the default wysiwyg editor "htmlAREA". I ran into some odd problems getting blockquote to work - basically the button wouldn't show up, and the plugin didn't indicate that it was loading in the TinyMCE help/plugins pop-up.

After a bit of troubleshooting, I finally determined that, for some reason, blockquote doesn't like to be initialized in serendipity_event_tinymce.php tinyMCE_GZ.init -and- tinyMCE.init.

By default, the plugins string ($tinymce_plugins) loads once in the MCE_GZ init for PHP compressor, and again the MCE.init as part of the standard initialization.

The work around/fix for this in my case was to hardcode the blockquote plugin in the plugins string in _event_tinymce.php in tinyMCE.init only, and remove it from my S9Y config plugins string.

I also added the suggested "blockquote_clear_tag : 'p'" in tinyMCE.init as well.

Code: Select all

<script language="javascript" type="text/javascript">
if (!window.tinymce_inited) {
	tinyMCE.init({
        mode
            : "exact",
        elements
            : "serendipity[body],serendipity[extended]<?php echo $article_only ? '' : ',serendipity[plugin][content],serendipity[plugin][pre_content]'; ?>",
        language
            : "<?php echo substr(WYSIWYG_LANG, 0, 2); ?>",
        theme
            : "advanced",
        plugins
            : "<?php echo $imanager ? 'imanager,' : ''; echo $tinymce_plugins!=''? $tinymce_plugins : ''; ?>,blockquote",
        blockquote_clear_tag
            : "p",
        theme_advanced_buttons1
            : "<?php echo $theme_advanced_buttons1 ?>",
Incidentally, I tested all of this in a standalone TinyMCE instance too...the behavior is the same inside, and outside of S9Y, so is no fault of S9Y - I'm not even sure how one might address this within the context of the plugin, except to document the potential for odd behavior.

Hope this helps someone, someday.

Adam
Post Reply