We're using plone multisite to have one "source" plone site that can push content to various "target" plone sites. Works pretty well. Our customer had a new request: if you add images to the source site and include them in the kupu editor, they ought to be pushed along with the actual object you're working on. It looked a bit complicated, so I send off an email to the plone users mailinglist.
Duncan was quick to reply that kupu includes a ReftextField that can serve as a drop-in replacement of the regular TextField. The change is that it adds archetype references to the images that are included. And... archetype references are used by plone multisite to detect dependent content that should be dragged along to the target site! A bit of coding later and it worked. Great :-) Some comments:
I could hardly find any reference to ReftextField, so I thought a blog entry was in order to draw some attention to it :-)
Tags: plone
My name is Reinout van Rees and I program in Python, I live in the Netherlands, I cycle recumbent bikes and I have a model railway.
Most of my website content is in my weblog. You can keep up to date by subscribing to the automatic feeds (for instance with Google reader):
Bug is that atct's text field gets initialized as a BaseUnit (with a mimetype attribute) instead of as an empty string. ReftextField's set() method then things "not a string? Let's do a seek()". And BaseUnit gives an AttributeError.
Solution: add an "if BaseUnit" and do a "value = value()". Two-line fix, now included in kupu.
Unsure what bug you discovered in ATContentType CTs but I noticed when subclassing content based on ATCT, I had to set the 'text' field to not be required (in the schema) and then modify the document_view (or whatever view template) to show my new ReftextField and not the default one (as well as the edit template iirc).