Render rich text widget manually in plone custom page

前端 未结 2 951
轻奢々
轻奢々 2021-01-15 18:27

I have a custom edit (browser page) for my dexterity content type. In template I have defined a form using Bootstrap and added some Angular JS code for form behavior. It is

相关标签:
2条回答
  • 2021-01-15 19:02

    If you are using Mockup (not sure if anybody use it on Plone 4) you can find tips there: Obtaining the "default" mockup TinyMCE configuration on Plone 5

    Otherwise (the Plone 4.3 version of TinyMCE) it's only a matter of CSS classes and configurations.

     <textarea name="..."
         class="pat-tinymce mce_editable"
         data-mce-config JSONCONFIGURATION_HERE">
     </textarea>
    

    I've an add-ons that enable TinyMCE on simple forms; look at the cose to find how to obtain the JSON configuration: See rt.zptformfield.

    I've also a blogpost about the approach I used there but it's in italian :-) - http://blog.redturtle.it/usare-widget-plone-in-semplici-template-html

    0 讨论(0)
  • 2021-01-15 19:02

    It should suffice to apply the class mceEditor on the textarea.

    If that shouldn't work, include the initialization in your template:

    tinyMCE.init({
        elements : "id-of-textarea",
    }); 
    
    0 讨论(0)
提交回复
热议问题