[Zope] DTML-WITH Problem

Jan Lentfer Jan.Lentfer@web.de
Mon, 17 Sep 2001 18:48:18 +0200


At 12:33 16.09.2001 -0400, marc lindahl wrote:
>You should consider using one of the several photo gallery products already
>in existence...

hmm, no - that's too easy ;-). I am actually willing to learn, so I want to 
do most of the things on my own.
When I am done learning I am willing to take the easy way and use available 
products, but for now.....

Ok, I searched the archives again and again and took a glance at Dieter 
Maurer's book and found that it seems to be a bigger problem to adress an 
object (in my case a folder) by a path (=string).
Some of the solutions I found involved the use of "restrictedTraverse", so 
I played around with that for a while.

My site looks like that:

/
|-admin/---- managegallery.htm
       |
     galleries/ ---- gallery1/
                   ---- gallery2/

.....

in "managegallery.htm" I now have the following code:

<dtml-call expr="REQUEST.set ('working_folder', 'galleries.'+gallery_id)">
  <dtml-with expr="restrictedTraverse(_[working_folder])">
    <dtml-in expr="objectValues('Image')" sort=bobobase_modification_time 
reverse>
         <dtml-var title><BR>
   </dtml-in>
  </dtml-with>



Which gives me a KeyError, referencing an nonexistent object or variable.
Does anyone have an idea what is still wrong with my code?
I mean *to me* it looks like I at least was able to do the conversion from 
string to object, right? And now there's a problem that the object can't be 
found - for whatever reason.


Thanks in advance,

Jan




Jan@Mountainbikehq.de
http://www.MountainbikeHQ.de - Your home for DH, DS and CC Mountainbiking