Tag Archives: tinymce

multiple TinyMCE editors with sfWidgetFormTextareaTinyMCE

I noticed the other day that when using the sfWidgetFormTextareaTinyMCE widget which is part of the sfFormExtraPlugin plugin, it wouldnt display more than 1 editor on a page. After looking at the class and comparing the javascript to the javascript that was generated by the old textarea_tag() function I noticed a few differences.

To fix this, copy \plugins\sfFormExtraPlugin\lib\widget\sfWidgetFormTextareaTinyMCE.class.php to \lib\widgets\ and make the following change to the javascript:

<script type="text/javascript">
  tinyMCE.init({
    mode:                              "exact",
    theme:                             "%s",
    elements:                          "%s",
    %s
    %s
    theme_advanced_toolbar_location:   "top",
    theme_advanced_toolbar_align:      "left",
    theme_advanced_statusbar_location: "bottom",
    theme_advanced_resizing:           true
    %s
  });
</script>

You will probably have to create the \lib\widget directory. Dont forget to clear your cache.