I have been unable to follow the syntax of ExtImage class When called in the same folder in which it exists <dtml-var mgscrdrbit.png> returns <ExtImage instance at 019D8AD0> but I am unable to get img html string result in the form: <img src="http://localhost:8080/04_es/mgscrdrbit.png" border="0" alt="descrip" height="99" width="100"> by using something like <img src=<dtml-var mgscrdrbit.png>> in addition, if called from lower down the tree, giving the absolute pathname <dtml-var /04_es/mgscrdrbit.png> or <dtml-var '/97_swi/bubardot.gif'> produces Error Type: KeyError Error Value: '/97_swi/bubardot.gif' and This resource may be trying to reference a nonexistent object or variable '/97_swi/bubardot.gif'. on the other hand <dtml-in "PARENTS[0].objectValues(['ExtImage'])"> produces all the information Grateful for any guidance as the help file covers alll the arguements, but no obvious (to me) dtml syntax.
Mike Bunyan writes:
I have been unable to follow the syntax of ExtImage class When called in the same folder in which it exists <dtml-var mgscrdrbit.png> returns <ExtImage instance at 019D8AD0> It appears to have no useful "__str__" method.
Try: <dtml-with mgscrdrbit.png><dtml-var tag></dtml-with> This will work, it is has a "tag" method (as images normally have).
in addition, if called from lower down the tree, giving the absolute pathname <dtml-var /04_es/mgscrdrbit.png> or <dtml-var '/97_swi/bubardot.gif'> produces Error Type: KeyError Error Value: '/97_swi/bubardot.gif' Of course....
You do not have a variable named "/04_es/mgscrdrbit.png". You use "restrictedTraverse" in such circumstances.... This was an FAQ. E.g. explained in URL:http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html Dieter
participants (2)
-
Dieter Maurer -
Mike Bunyan