[Zope] HELP needed to build image macro for documents

Steven Smith ssmith@mustang1965.com
Wed, 26 Feb 2003 23:54:53 -0500


I'm new to Zope/Plone, but it looks to be a great product for my needs 
on a web project. I have not built custom pages in Zope (yet) and was 
hoping some people could help me get started.

My question:
I'm creating documents and want to add images into the documents. I 
could just create an image tag, but I want to take advantage of 
Zope/Plone and what it can do. I understand the concept that everything 
in Plone is a object. As a result everything can have a Title and 
Description. This "Description" is what I want to take advantage of. I'm 
adding images and putting text in the description area that I later want 
to appear as a caption under the image.

I would like to figure out some simple DHTML(Python, ZPT, or other code) 
code that I could use in my documents to reference the image and get 
back the image with description. This small amount of Python/DHTML would 
need to build a build a html table around the image, then in second cell 
under image insert the text from image's description field (if 
description not blank).

My problem is that I don't understand enough of Zope/Plone to figure out 
the best method of creating this insert code. I had thought that the tag 
would act like a sub-routine call which would pass the image name 
requested to some larger piece of code which would query Zope/Plone for 
the image and description, build the html table code I wanted, then 
return all this back to the Document that called it. The end user of 
course doesn't see more than the HTML used to generate the page.

I'll try to answer some questions before they are asked.
     The documents are just almost plain text pages. They have some html 
to bold words or make paragraph headings, but no really fancy html.
     I was thinking that I could make a macro in the header or some page 
always called when you view a document. This way I could put only a 
small tag into the Document that would reference a macro. This small tag 
would pass the macro an image name(ID) and whether to put on right of 
left side of page.

I created a small demo of the kind of page I'm trying to achieve at:
http://www.mustang1965.com/history.html

Any advice on where to start would be much appreciated.

Thanks,