Newbie question re referring to items
Hi all, Feel stupid for asking this question, but can't work it out... Given a folder structure similar to the following: / test images content How does a dtml document in /test/content obtain an image from the /test/images folder, without using the <img...> tag. I want to be able to get it using <dtml-var ...> anu *************************** IMPORTANT NOTE ************************** The above information is confidential to the addressee and may be privileged. Unauthorised access and use is prohibited. William M. Mercer Limited is regulated by IMRO and the Personal Investment Authority. Registered in London No. 984275 Registered Office: Telford House, 14 Tothill Street, London SW1H 9NB
Given a folder structure similar to the following:
/ test images content
How does a dtml document in /test/content obtain an image from the /test/images folder, without using the <img...> tag. I want to be able to get it using <dtml-var ...>
<dtml-var images.imagename> As you see, you can't use dots in the imagename if you use this syntax, which isn't a proble,. If you for some reason must have dots in the imagename, this is also doable, but it gets more complex then, so thats step 2. :-)
On Mon, 11 Feb 2002, Lennart Regebro wrote:
Given a folder structure similar to the following:
/ test images content
How does a dtml document in /test/content obtain an image from the /test/images folder, without using the <img...> tag. I want to be able to get it using <dtml-var ...>
<dtml-var images.imagename>
As you see, you can't use dots in the imagename if you use this syntax, which isn't a proble,. If you for some reason must have dots in the imagename, this is also doable, but it gets more complex then, so thats step 2. :-)
Please come with an example. Pictures usually end in .gif or .jpg, so it would be helpful to have an example...:) -- Robin
From: "Robin Smidsrod" <robin@etools.no>
Please come with an example. Pictures usually end in .gif or .jpg, so it would be helpful to have an example...:)
Oh, but you can name pictures whatever you want in Zope. Life gets easier if you don't have dots in the object-id's. But some of the other examples posted here yesterday works. "Images['filename.gif'] works, for example.
Gupta, Anu writes:
Feel stupid for asking this question, but can't work it out... Did you read the Zope book or <http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html>?
Given a folder structure similar to the following:
/ test images content
How does a dtml document in /test/content obtain an image from the /test/images folder, without using the <img...> tag. I want to be able to get it using <dtml-var ...> Background reading will tell you about the following options:
* "<dtml-with images><dtml-var myimage></dtml-with>" * '<dtml-var expr="restrictedTraverse(path_to_your_image)">' * '<dtml-var expr="images[name_of_your_image_as_string]">' * '<dtml-var expr="images.your_image">' Read a bit, learn about the various restrictions and select the best alternative for you. Dieter
participants (4)
-
Dieter Maurer -
Gupta, Anu -
Lennart Regebro -
Robin Smidsrod