dtml-in and getting the title of pictures
Hi all, I would like to step through all the pictures in a folder. I am using the follwing code: <dtml-in "objectIds('Image')"> <table border=1><tr><td><IMG Src="<dtml-var sequence-item>l"> <dtml-with "_['sequence-item']"> <dtml-if title></td></tr><tr><td align=center><i><dtml-var title></i></dtml-if> </dtml-with> </td></tr></table> </dtml-in> This will give me a table for each picture found, it will display the Image but the title used is that of my dtml-method I am calling this from. I know the Images have a title property set. If I use "only" in the dtml-with above, I will get no title at all. Am I right that sequence-item does not contain an onbject but a string of the id? I am using this inside an ArticleStore of KM|net News, so it's still possible that there's a problem with that... What am I doing wrong? Jochen
On Mon, 20 Dec 1999, Jochen Haeberle wrote:
Hi all,
I would like to step through all the pictures in a folder. I am using the follwing code:
<dtml-in "objectIds('Image')"> <table border=1><tr><td><IMG Src="<dtml-var sequence-item>l"> <dtml-with "_['sequence-item']"> <dtml-if title></td></tr><tr><td align=center><i><dtml-var title></i></dtml-if> </dtml-with> </td></tr></table>
Jochen - You could use objectValues instead of objectIds which will iterate through the objects as before but make their attributes available in the local namespace. Something like:
<dtml-in "objectValues('Image')"> <table border=1><tr><td><IMG Src="<dtml-var id>"> <dtml-if title></td></tr><tr><td align=center><i><dtml-var title></i></dtml-if> </td></tr></table>
Merry Xmass Pavlos
participants (2)
-
Jochen Haeberle -
Pavlos Christoforou