[Zope] The old dmtl namespace question

Oliver Bleutgen Oliver Bleutgen <myzope@gmx.net>
Wed, 6 Jun 2001 16:06:47 +0200


> David,
> Thanks for the help, but I am still stuck.
> Since I am calling a method in another folder I am a bit stuck.

> If I use
> 1. <dtml-var folder2.method2>
>   I get a KeyError error on folder2.method2
>   So I try
> 2. <dtml-var "folder2.method2">
>   But it does not render
>   So I try
> 3. <dtml-var "folder2.method2()">
>   But it looses the namespace and I get a KeyError on method3
>   So I try
> 4. <dtml-var "folder2.method2( _.None, _ )">
>   But it behaves the same as 1.
>   So I knock my head on the table and scream!

You get the key error in 4 because you were
calling folder2.method2 from method1, I guess
David missed that:


=> >I have:-
=> >
=> >Folder1
=> >  - method1
=> >Folder2
=> >  - method2  <- this method calls method3
=> >  - method3
=> >
=> >When I call an object like this...
=> >>From  method1
=> ><dtml-call "REQUEST.set('variable','value')">  <- I want to set some
=> >variables too
=> ><dtml-var "folder2.method2">
=> >
=> >The method works perfectly, except that it does not render.
=> >

So if the folder above folder2 and folder1 is the root folder
I think
<dtml-var "PARENTS[-1].folder2.method2( _.None, _ )">
should do it. 

If your folders are subfolders of the folder "parentfolder",
you can use
<dtml-var "parentfolder.folder2.method2( _.None, _ )">.

hope this helps,
oliver