How to reuse Products.TinyMCE (Solved)

I have a custom edit page which has several richtext (textarea) fields, trying to get tinymce to work for all these fields.

Any sample to share on how to do this? Am using Plone 4.3.14.

Do you use 'Richtext' for the fields, like

some_field = RichText(
bla bla
}

(and do you use the widget to display them) ?

This is a custom form, not using the auto-generated richtext widget.

Probably (I did not test), you have to do

a)

Add javascript to init TinyMCE, something like:

tinyMCE.init({
elements : "imyid",
});

or

Or use mockup:

<textarea id="myid" class="pat-tinymce mce_editable">
 </textarea>

Found the method:

<div tal:define="field python:context.body;
                 fname string:body;
                 force_wysiwyg python:True;
                 inputname string:body;
                 inputvalue context/body/output;
                 id string:body;
                 rows python:70;">
  <div metal:use-macro="context/tinymce_wysiwyg_support/macros/wysiwygEditorBox">
    The WYSIWYG code
  </div>
</div>

Plone Foundation Code of Conduct