[Zope] Newbie question re referring to items

Gupta, Anu Anu.Gupta@uk.wmmercer.com
Tue, 12 Feb 2002 09:26:02 -0000


Thanks for all the help guys...

Actually, I knew these techniques, but for some reason, they were failing. 

Suddenly I realised I had a different images folder one level up which was
being acquired rather than the images directory I wanted, higher up the
tree.

Moral - delete temporary folders before they bite you in the ass - and think
before posting. Still, maybe someone else will search on this one day, and
save 10 minutes of their time !



-----Original Message-----
From: Dieter Maurer [mailto:dieter@handshake.de]
Sent: 11 February 2002 20:12
To: Gupta, Anu
Cc: 'zope@zope.org'
Subject: Re: [Zope] Newbie question re referring to items


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

*************************** 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