[Zope] images as properties of a document.
Robert Segall
roseg@apsis.ch
Thu, 19 Jul 2001 11:00:50 +0200
On Wednesday 18 July 2001 19:50, you wrote:
> If you are creating a structured template, you might want to create a
> product using a ZClass. I did something very similar. Then I
> programmatically add the image that they selected in the data entry form.
>
> -----Original Message-----
> From: Tom Cameron [mailto:tom@mooball.com]
> Sent: Tuesday, July 17, 2001 11:09 PM
> To: zope@zope.org
> Subject: [Zope] images as properties of a document.
>
>
> I am wondering how I might create a property of a DTML Document that is an
> image.
>
> In the standard implementation of a DTML Document, the properties can be
> strings, lines, text etc. I would like to create a new type of document
> with the ability to create a property that is an image and upload it to the
> page as you edit the property.
>
> Can anybody suggest how I would go about this? I have not created a product
> before, but I am game to try. I am really looking for some hints and tips.
> Perhaps an existing product that is similar that I could copy or subclass.
>
> As a further explanation, I am trying to create a very structured template
> page. The end user simply edits the properties of the page and I create the
> templates and how it renders by modifying the index_html method. I have
> looked at ZPT and they dont seem to do exactly what I want.
>
> TIA
> Tom Cameron
I have done this the other way around: start with a ZClass derived from Image
and add the text properties (in the property sheets) and the display methods
(such as index_html). Set the default View to whatever method fits your
needs. Create an additional view/method for editing that includes the
string/text properties and an (optional) file upload for the image.
--
Robert Segall
Apsis GmbH
Postfach, Uetikon am See, CH-8707
Tel: +41-1-920 4904