[Zope] comparing variables from different name spaces?

Chris McDonough chris@iqgroup.com
Mon, 27 Sep 1999 19:05:52 -0400


Ainis,

You can do this by using the PARENTS object.

For example, the following (untested) code, when run from
http://youserver/test/dir2/hardware/prices/index_html (assuming index_html
is a dtml method and not a dtml document -- a dtml document has its own
properties) will give you the id of the /test/dir2 folder:

<!--#var "PARENTS[2].id"-->

e.g. it will print "dir2"

While:

<!--#var "PARENTS[1].id"--> will give you the id of the hardware folder
(e.g. it will print "hardware"), et. al.

I think this is what you're looking for..

-----Original Message-----
From: Ainis [mailto:ainis@mindless.com]
Sent: Monday, September 27, 1999 6:40 PM
To: zope@zope.org
Subject: [Zope] comparing variables from different name spaces?


Hello ALL,
     How do i compare variables from two different namespaces?

In my current situation I need to check if my current path is in some
directory tree. For example lets say I have folders
/test/dir1
/test/dir2
/test/dir3

In these folders there are alot more other folders, so when i currently
am in for example
/test/dir2/hardware/prices/index_html
the script should check in which of those 3 root folders (dir1, dir2
or dir3) am i.

Now lets look at the part of /test/dir2/hardware/prices/index_html source:

<dtml-with test>
  <dtml-in "objectValues(['Folder'])">
    <!--#var id-->
  </dtml-in-->
</dtml-with-->

Ok, so in this case i have a loop in which i go through ids of all
folders in /test/ but now how do I check test's subfolder's id is PARENT
of my current /test/dir2/hardware/prices/ folder?
I think the easiest way would be- <dtml-if dir2> but that has to be
done only from /test/dir2/hardware/prices/ names pace which (i think)
I have already lost with <dtml-with test>.
So how do I compare the older name space's variable with
newer one's?

I also tried some tricks with <dtml-with blah only> but with no
success.

P.S. excuse me if this turns out to be lame question, I'm a bit new to Zope


Best regards,
 Ainis                          mailto:ainis@mindless.com



_______________________________________________
Zope maillist  -  Zope@zope.org
http://www.zope.org/mailman/listinfo/zope

(To receive general Zope announcements, see:
http://www.zope.org/mailman/listinfo/zope-announce

For developer-specific issues, zope-dev@zope.org -
http://www.zope.org/mailman/listinfo/zope-dev )