TinyMCE pattern

August 18, 2025 ยท View on GitHub

Use the TinyMCE editor for HTML editing.

Configuration

OptionTypeDefaultDescription
relatedItemsobject{ attributes: ["UID", "Title", "Description", "getURL", "portal_type", "path", "ModificationDate"], batchSize: 20, basePath: "/", vocabularyUrl: null, width: 500, maximumSelectionSize: 1, placeholder: "Search for item on site..." }Related items pattern options.
uploadobject{ attributes: look at upload pattern for getting the options list }Upload pattern options.
textobject{ insertBtn: "Insert", cancelBtn: "Cancel", insertHeading: "Insert link", title: "Title", internal: "Internal", external: "External", email: "Email", anchor: "Anchor", subject: "Subject" image: "Image", imageAlign: "Align", scale: "Size", alt: "Alternative Text", captionFromDescription: "Show Image Caption from Image Description", caption: "Image Caption", externalImage: "External Image URI"}Translation strings
imageScalesstringImage scale name/value object-array or JSON string for use in the image dialog.
targetListarray[ {text: "Open in this window / frame", value: ""}, {text: "Open in new window", value: "_blank"}, {text: "Open in parent window / frame", value: "_parent"}, {text: "Open in top frame (replaces all frames)", value: "_top"}]Possible targets for plonelink plugin
imageTypesstring'Image'Selectable Image types. Used in ploneimage plugin.
folderTypesstring'Folder,Plone Site'Browseable folderish types. Used for pat-relateditems in ploneimage and plonelink plugin.
tinyobject{ plugins: [ "advlist", "autolink", "lists", "charmap", "print", "preview", "anchor", "searchreplace", "visualblocks", "code", "fullscreen", "insertdatetime", "media", "table", "contextmenu", "paste", "plonelink", "ploneimage" ], menubar: "edit table format tools view insert", toolbar: "undo redo | styles | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | unlink plonelink ploneimage", autoresize_max_height: 1500 }Default TinyMCE configuration options. These are set via configuration registry.
prependToUrlstring""Text to prepend to generated internal urls.
appendToUrlstring""Text to append to generated internal urls.
prependToScalePartstring"/imagescale/"Text to prepend to generated image scale url part.
appendToScalePartstring""Text to append to generated image scale url part.
linkAttributestring"path"Ajax response data attribute to use for url.
defaultScalestring"Original"Scale name to default to.
inlinebooleanfalseShow tinyMCE editor inline instead in an iframe. Use this on textarea inputs. If you want to use this pattern directly on a contenteditable, pass "inline: true" to the "tiny" options object.

Examples

Default

<form>
    <textarea
        class="pat-tinymce"
        data-pat-tinymce='{"relatedItems": {
                           "vocabularyUrl": "/relateditems-test.json"
                           }}'
    ></textarea>
</form>

With dropzone

<form>
    <textarea
        class="pat-tinymce"
        data-pat-tinymce='{"relatedItems": {"vocabularyUrl": "/relateditems-test.json" },
                       "upload": {"baseUrl": "/", "relativePath": "upload"}
                       }'
    ></textarea>
</form>

Inline editing

<form>
    <textarea class="pat-tinymce" data-pat-tinymce='{"inline": true}'>
   <h3>I'm a content editable</h3>
   <p>Try to edit me!</p>
 </textarea
    >
</form>