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
Jan Lentfer writes:
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). You found something like that in my book?
Then, apparently, I need to change something. It is not a "bigger" problem to address an object! You use "Computed Attribute Access", "Computed Variable/Object Access" or "restrictedTraverse". All not too difficult....
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])"> Here you use both "Computed Object Access" *AND* "restrictedTraverse". Use just one, not both:
<dtml-with expr="restrictedTraverse(working_folder)"> or <dtml-with expr="_.getitem(working_folder)"> You read in my book the difference between "_.getitem(...)", and "_[...]"? You already understand why to use "getitem" rather than subscription? Dieter
participants (2)
-
Dieter Maurer -
Jan Lentfer