How can I use an unregistered opensource plugin for TinyMCE

The codesample plugin is an opensource/free one that ships with TinyMCE and appears to be in the plone static code. But it's not an option in the plugins menu vocabulary. Would it be appropriate to add it as a custom plugin? I'm not sure if this is possible - I couldn't find standalone code for it.

Also, as a proof of concept, I tried adding it as a vocabulary item in ITinyMCEPluginSchema.plugins but this gives me a WrongContainedType error

2026-04-10 12:35:29 ERROR [Zope.SiteErrorLog:35][waitress-1] WrongContainedType: http://localhost:8080/pds/@@tinymce-controlpanel
Traceback (innermost last):
  Module ZPublisher.WSGIPublisher, line 181, in transaction_pubevents
  Module ZPublisher.WSGIPublisher, line 390, in publish_module
  Module ZPublisher.WSGIPublisher, line 284, in publish
  Module ZPublisher.mapply, line 98, in mapply
  Module ZPublisher.WSGIPublisher, line 68, in call_object
  Module plone.z3cform.layout, line 61, in __call__
  Module plone.z3cform.layout, line 45, in update
  Module plone.z3cform.fieldsets.extensible, line 62, in update
  Module plone.z3cform.patch, line 31, in GroupForm_update
  Module z3c.form.group, line 146, in update
  Module plone.app.z3cform.csrf, line 21, in execute
  Module z3c.form.action, line 99, in execute
  Module z3c.form.button, line 312, in __call__
  Module z3c.form.button, line 167, in __call__
  Module plone.app.registry.browser.controlpanel, line 60, in handleSave
  Module z3c.form.group, line 117, in applyChanges
  Module z3c.form.group, line 83, in applyChanges
  Module z3c.form.form, line 55, in applyChanges
  Module z3c.form.datamanager, line 89, in set
  Module plone.registry.recordsproxy, line 48, in __setattr__
  Module plone.registry.registry, line 45, in __setitem__
  Module plone.registry.record, line 79, in _set_value
  Module zope.schema._bootstrapfields, line 295, in validate
  Module zope.schema._field, line 773, in _validate
zope.schema._bootstrapinterfaces.WrongContainedType: ([ConstraintNotSatisfied('codesample', '')], 'value')

I do have prismjs installed as a resource, that's working already.

Ah, of course - this is set in a registry record.

So the steps to make this work, or presumably any other default plugin, are simple:

  1. Add to the plone.plugins record
  2. Add to plone.toolbar record
  3. Download prism js and css and create and register a bundle for it.

Oh that’s interesting and should be on our (my) mockup maintenance list to check for new tinymce plugins when upgrading … I’ll prep a PR to implement all the available plugins from Tiny 8 again. You can also create an issue in the mockup repo and ping the classic-ui team. Then you will get faster response on that.

As you've already mentioned, the custom_plugins field only works if you have standalone resources available. Unfortunately you cannot access already packed plugin chunks from there.

1 Like

Thank you Peter!
Side note: what an odd icon they chose for that plugin. I'll have to change that with css, I don't think any editor would find that intuitive.