[Zope] Re: newbie question: make reference to a 'foreign' variable

Michael R. Bernstein webmaven@lvcm.com
08 Feb 2003 10:28:12 -0800


On Sat, 2003-02-08 at 08:32, Sungmook Kim wrote:
> Hi,
> 
> sorry, I meant the folder A is not a subfolder of B
> but of some other folder X which is also a root folder
> itself.
> 
> -B
>  |
>  --variable(dtml method)
> -X
>  |
>  -A
>   |
>   --dtml-document(here, i want to make a reference to
> the variable in folder B)

Ok, you seem to be using 'root folder' to mean 'a folder in the root
folder'. There is onmly one root folder ('/').

So your diagram should be:

/
+-B
| +-variable
|
+-X
  +-A
    +-dtml-document

So, the simple way to solve this is to start from the root folder and
work your way down:

<dtml-with "PARENTS[-1]">
 <dtml-with B>
  <dtml-var variable>
 </dtml-with>
</dtml-with>

"PARENTS[-1]" always get's you the root folder in Zope. This code will
always get you variable-of-B-of-root, no matter where in the tree you
call it from.

-- 
Michael R. Bernstein <webmaven@lvcm.com>