[Zope] Please help with Rendering Images in DTML
Gary Speer
gspeer@cortech.org
Sat, 25 Jan 2003 20:58:02 -0700
Hello all -
I feel like I'm beating my head in searching for the right syntax. I'm sure
no one else has been there ....
Anyway, here's the challenge:
In a DTML method, a string is constructed in a variable that is the relative
URL of an Image.
For example ...
<dtml-let MyImageId="'folder/subfolder/myimage.jpg'">
using
<dtml-var MyImageId> results in just the string being returned
a hand constructed image tag like
<img src=<dtml-var MyImageID> alt="">
will render the desired image, but does not provide access to its 'Image
object' attributes like height and width.
various rendering syntax such as
<dtml-var render(MyImageId)>
or
<dtml-var _.getitem(MyImageId)>
and any other variations I can come up with all merely render the string's
content instead of the object I am trying to point to.
Please advise:
a) the syntax to render the object using a variable that contains its
relative URL
and
b) the 'dtml-var' syntax to access an attribute that it has as an Image
object, such as it's width.
c) On an unrelated subject, what is the syntax to parse the contents of
QUERY_STRING using the + sign as a delimiter instead of an operator. For
example, the QUERY_STRING has the value arguement1+arguement2+arguement3.
how would you construct a dtml-var statement that would render only
'arguement2'.
An extensive Google search and review of the book did not find the answers.
Any guidance will be greatly appreciated.
Best regards,
Gary