[Zope] Icon Product?

Casey Duncan cduncan@kaivo.com
Fri, 17 Aug 2001 08:33:28 -0600


"Keith J. Farmer" wrote:
> 
> I'm trying to create an icon zclass for use in navbars.  I've created a
> zclass containing string attributes link, alt_text, and image (as a
> url).  I've tried various ways including python script to get the icon
> to render as
> 
>         <a href="..link.." alt="..alt_text.."><.. img tag ..></a>
> 
> to no avail.
> 
> I'd prefer to keep the calling syntax as brief as possible (otherwise,
> what's the point of the class?).  Anybody have any suggestions (or
> existing products)?
> 

This would be a nearly trivial product to write in Python, just create a
class subclassing OFS.Image.Image, add a property to store the link (use
the _properties attr) and override the tag method to return the code you
are looking for. Then modify the existing image add form (in
lib/python/OFS/dtml) to add a field for the link. 

Take a look at the existing image code (lib/python/OFS/Image.py) to see
how it works (specifically the tag method).

hth,
-- 
| Casey Duncan
| Kaivo, Inc.
| cduncan@kaivo.com
`------------------>