In a namespace like: mysite |_images |_mytemplate |_myportal How do I access images from myportal with a <dtml-var> ? I cannot find a help reference for this action and <dtml-var /mysite/images> does not work and neither does any other combination I can find. Do I need to do this with a python expression?
Hello Matt.
I cannot find a help reference for this action and <dtml-var /mysite/images> Try this: <dtml-var "mysite.images.mypic.tag()"> this creates a complete <img>-tag with width,height and alt.
If your picture is called mypic.gif, which means it has an extension named "gif", separated by a dot, this will not work. <dtml-var "mysite.images.mypic.gif.tag()"> Zope will tell you that mypic has no attribute named "gif". But this will work: <dtml-var "mysite.images['mypic.gif']"> or even <dtml-var "mysite.images['mypic.gif'].tag()"> The results are the same. Greetings Sven Rudolph
Thanks so much. This looks like it will solve my problems :) ----- Original Message ----- From: "Sven Rudolph" <sven@spaghetticode.de> To: <zope@zope.org> Sent: Monday, April 01, 2002 9:50 AM Subject: Re: [Zope] DTML Question
Hello Matt.
I cannot find a help reference for this action and <dtml-var /mysite/images> Try this: <dtml-var "mysite.images.mypic.tag()"> this creates a complete <img>-tag with width,height and alt.
If your picture is called mypic.gif, which means it has an extension named "gif", separated by a dot, this will not work. <dtml-var "mysite.images.mypic.gif.tag()"> Zope will tell you that mypic has no attribute named "gif".
But this will work: <dtml-var "mysite.images['mypic.gif']"> or even <dtml-var "mysite.images['mypic.gif'].tag()"> The results are the same.
Greetings
Sven Rudolph
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (2)
-
Matt Gregory -
Sven Rudolph