Static text portlet, Plone 4, 1.x

For Plone 4 sites using 1.x, the static text portlet is broken in number of ways (TinyMCE configuration, etc). I can fix this by modifying plone.portlet.static to play nice with newer-than-supported versions, but this seems to have side effects on other portlets.

I tried 3.0.2, 1.x HEAD plus plone.portlet.static HEAD with modifications [1] to use z3c.form based static portlet, with success. But this has the side effect of breaking other portlets, like Navigation, etc. I get the sense that there's not a version of beyond 2.5.4 that actually works with Plone 4, which leaves me stuck.

I need to know if it is a fools errand to try and backport z3c.form-based portlets to Plone 4? My goal is to not have a zero sum game between using and static text portlets in Plone 4. Thoughts? Should I just try to JBOT the broken formlib-based portlet instead?


[1] My experimental modifications to plone.portlet.static to make the text field work like the way TinyMCE would work in a Dexterity content form, of course predicated on possibility that there is a z3c.form-based that will actually work in Plone 4 at all

I should clarify, what matters is getting AutoExtensibleForm-based portlet as the means to use a configured widget (via directive). I could, I suppose, try adding an updateWidgets() to the non-autoform based portlet forms in plone.portlet.static to allow me to continue to use 2.5.x?

I also ran into this problem (TinyMCE not loading in Static Text portlet on Plone 4.3), and created a fork with a fix. It's available at as plone.portlet.static version

For the record, I had submitted this fix as a PR, but a different PR was accepted instead (the code for it was simpler), and that became version 3.0.2. I have not tested that version, but I suspect will work for you.

Thanks for linking to this, here is my initial assessment of the situation:

(1) Your fix should work, but only if is installed (cannot import RichTextFieldWidget without). I'm just trying to use widgets 1.x without p.a.contenttypes. This could be modified to work around (conditional import and redefinition of RichTextFieldWidget factory function is simple enough).

(2) @thet's fix here does not accomplish the same thing as your fork, it only preserves status-quo functionality for Plone 4 (but widget configuration will not work). Things that are broken without the configuration that is providing include: browsing links, browsing images, any button, plugin, or style configuration. What one gets here is a stock TinyMCE 4 that breaks in subtle ways.

(3) Upload through TinyMCE from static portlet is broken AFAICT no matter what (though I have not tested all permutations).

I think I may try to experiment building on what you put together here:

... I am hoping that a minor change here might allow me to use your fork without installing (so that 1.x will expose the factory for the widget). OTOH, I might just expose the widget factory in 1.x regardless of installation status.

I will update this thread once I come to some kind of workable conclusion.


I have not yet created a pull request for 1.x branch, as I am working through a laundry list of fixes, but this commit on my fork will make's @cdw9's plone.portlet.static fork work nicely on Plone 4 sites using, but not

1 Like

@cdw9: with this commit to my fork of 1.x, TinyMCE now plays nice with your plone.portlet.static fork for uploads and link browsing root for the static text portlet:

I am going to aim to submit pull request for 1.x branch of sometime later this week.

@cdw9 @thet: I have made an attempt (still on forks, no PRs yet) to harmonize plone.portlet.static and based on work you both have done thus far -- here are my attempts:

The result of these, collectively, are the following improvements:

  • TinyMCE pattern is configured consistently with other uses on site.
  • No need to port the formhelpers from newer, I just mixed in AutoExtensibleForm (though I did need to use conditional imports for this).
  • Folder context for links is not assignment manager, but folder content.
  • Upload context is likelwise adjusted, and uploads through TinyMCE in static text portlet now work.

I may submit pull request(s) as soon as tomorrow, but I'm still working on some other fixes in 1.x branch.