Page 1 of 1

Staticpage and TinyMCE, 1.5beta1 FIX

Posted: Thu Nov 19, 2009 6:58 pm
by jfried
I found the editor would only load on the static page content text area and not the pre-content.
Also any changes were not saved properly.

I dug around and found its a problem with the way TinyMCE is configured in its plugin, it looks for fields with the id of serendipity[plugin][content] and serendipity[plugin][pre-content]. Well on the static page the id's are all "nuggets#". Seeing this as a retarded setup I patched the
/plugins/serendipity_event_staticpage/serendipity_event_staticpage.php file in the following way.

Code: Select all

*** serendipity_event_staticpage.php    2009-11-18 16:55:06.000000000 -0600
--- serendipity_event_staticpage.php.new        2009-11-18 16:57:22.000000000 -0600
***************
*** 2163,2169 ****
              <td colspan="2">
  <?php           } ?>
                  <div>
!                     <textarea class="direction_<?php echo $lang_direction; ?>" style="width: 100%" id="nuggets<?php echo $elcount; ?>" name="serendipity[plugin][<?php echo $config_item; ?>]" rows="20" cols="80"><?php echo $hvalue; ?></textarea>
                  </div>

  <?php         if (!$is_smarty) { ?>
--- 2163,2169 ----
              <td colspan="2">
  <?php           } ?>
                  <div>
!                     <textarea class="direction_<?php echo $lang_direction; ?>" style="width: 100%" id="serendipity[plugin][<?php echo $config_item; ?>]" name="serendipity[plugin][<?php echo $config_item; ?>]" rows="20" cols="80"><?php echo $hvalue; ?></textarea>
                  </div>

  <?php         if (!$is_smarty) { ?>
After this patch, the tinymce editor loads on the pre-content and content fields correctly and saving works as well.

Re: Staticpage and TinyMCE, 1.5beta1 FIX

Posted: Fri Nov 20, 2009 5:43 am
by jfried
Ok so placing []'s in the ID attribute is not too smart, as its non compliant.
SO . or _ should be used instead.

This goes for normal article id tags, which would hinder custom css skinning.