[Zope] Accessing attributes - object with 'implicit' period in id
John Schinnerer
johnschinnerer@yahoo.com
Tue, 28 May 2002 23:26:28 -0700 (PDT)
Aloha,
I'm back with an example. My situation seems different than solutions
in recent threads, and I don't see how the answers thus far apply (if
they do).
I'm looping through the results of a catalog search, displaying
thumbnail images, caption, date, etc.. A thumbnail, linked to a
full-sized image, is displayed for each result:
...
<a href="<dtml-var imageURL>">
<img src="<dtml-var thumbURL>" border="0" alt="<dtml-var caption>">
</a>
...
imageURL and thumbURL are properties of each gallery item which point
to the actual image, and will be something like:
/gallery/thumbs/C03Valley001.jpg
I want to get the height and width attributes from each thumbURL item
and use them in the img tag attributes. But:
height="<dtml-var thumbURL.height>" does not work, giving:
Error Value: exceptions.KeyError on thumbURL.height in ""
I am assuming this is because in my situation all thumbURL items
returned are objects with periods in their IDs. So it's choking on
trying to find '/gallery/thumbs/C03Valley001.jpg.height' - is this the
case? Or is there some other problem here?
In any case, how do I access the attributes (like height and width) in
this situation, where the period in the actual ID is 'implicit' in
thumbURL?
thx,
John S.
__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com