Re: [Zope] - Yet another stupid question: image folders
On Mon, Dec 07, 1998 at 04:48:41PM -0500, Brian Lloyd wrote:
I see what you're saying now. I think this boils down to the usage of the __str__ method of Image objects:
def __str__(self): return '<IMG SRC="%s" ALT="%s">' % (self.__name__, self.title_or_id())
Right this is what I was tweeking the other night trying to get this to work, but couldn't figure out how to find it's hierarchy.
I believe that this was added as a little convenience, rather than a universally applicable thing. The problem here is that you want (need) control over the SRC attribute. I would suggest that it's better all around to simply use a bit of DTML like:
<img src="images/logo" alt="<!--#var "logo.title_or_id()"-->" width="<!--#var "logo.imgWidth"-->" ...>
Maybe I'm lazy, but this seems like an AWEFUL lot of work that can't be automated by site tools (ney Dreamweaver), and that shouldn't be needed to be typed 5000 times when it's nearly always identical. I understand I'm looking for an easy solution, BUT... for example, in Frontier, yo ucan type something like: #image "blah.gif" And it will insert everything needed (including H/W tags). This works even if you happen to have things stored in a subdirectory if I recall (it's been a while). I know that most sites Zope has been used for probably aren't that graphically intense, but a lot that I work on are, and I'd be stuck with nearly a billion of these refernces or writing custom code that probably is identical to other people's custom code. For the object repository to be useful, it has to be able to SIMPLIFY my life, not complicate it :-) So since I'm a glutton for punishment, why wouldn't a tag: <!--#var imagename--> Be allwoed to insert it's location in full, rathre than relative (which should never break anything I can thinik off off-hand), as well as it's ALT and H/W tags (which maybe should be stored in properties now that I think about it, and only updated when the image is inserted into the database/updated, lower overhead). Humor me here :-) Chris -- | Christopher Petrilli | petrilli@amber.org
Hi Christopher (Christopher G. Petrilli), in <19981207165230.33257@amber.org> on Dec 7 you wrote:
#image "blah.gif"
And it will insert everything needed (including H/W tags). This works even if you happen to have things stored in a subdirectory if I recall (it's been a while). [...] So since I'm a glutton for punishment, why wouldn't a tag:
<!--#var imagename-->
Be allwoed to insert it's location in full, rathre than relative (which should never break anything I can thinik off off-hand), as well as it's ALT and H/W tags (which maybe should be stored in properties now that I think about it, and only updated when the image is inserted into the database/updated, lower overhead). Humor me here :-)
Time to write a new dtml tag? : <!--#img imagename--> Kent
On Mon, Dec 07, 1998 at 04:14:07PM +0000, Kent Polk wrote:
Hi Christopher (Christopher G. Petrilli), in <19981207165230.33257@amber.org> on Dec 7 you wrote:
#image "blah.gif"
And it will insert everything needed (including H/W tags). This works even if you happen to have things stored in a subdirectory if I recall (it's been a while). [...] So since I'm a glutton for punishment, why wouldn't a tag:
<!--#var imagename-->
Be allwoed to insert it's location in full, rathre than relative (which should never break anything I can thinik off off-hand), as well as it's ALT and H/W tags (which maybe should be stored in properties now that I think about it, and only updated when the image is inserted into the database/updated, lower overhead). Humor me here :-)
Time to write a new dtml tag? : <!--#img imagename-->
I guess I'm not sure why an Image should be any different than any other object in the POS? Seems to me the #var tag would work just fine with the tweeks I mentioned. Did I miss something? Chris -- | Christopher Petrilli | petrilli@amber.org
At 04:52 PM 12/7/98 -0500, Christopher G. Petrilli wrote:
For the object repository to be useful, it has to be able to SIMPLIFY my life, not complicate it :-)
So since I'm a glutton for punishment, why wouldn't a tag:
<!--#var imagename-->
Be allwoed to insert it's location in full, rathre than relative (which should never break anything I can thinik off off-hand), as well as it's ALT and H/W tags (which maybe should be stored in properties now that I think about it, and only updated when the image is inserted into the database/updated, lower overhead). Humor me here :-)
The correct way (I'm sure the DC folks will correct me if I'm wrong) to do this in ZOPE is to create a new 'image' Product that does what you want, then use it any place you currently use images. Long term, ZOPE classes will allow you to do this in a more direct way. In ASDF, you can define any file extension to wrap methods from anywhere, so you can directly subclass the ImageFile class (or any other 'built-in' ASDF class) to do whatever you want it to. I'm assuming that ZOPE classes will offer comparable functionality.
participants (3)
-
Christopher G. Petrilli -
kent@eaenki.nde.swri.edu -
Phillip J. Eby