[Zope] Two newbie questions

Chris Fassnacht cfassnacht@ssc.wisc.edu
Mon, 6 Sep 1999 16:32:39 -0500


Hi,

I'm new to Zope but have some programming experience and elementary
web-design skills.  I've been looking through the list archives, but haven't
found the answers to a couple of questions.  Hope someone can help.

1. Object reference across hierarchies.

If I have a folder structure like this:

          A
       /      \
     B        C
    / \       /  \
  D   E   F    G

Then I can reference an object in A, B, or D from A, B, or D using <dtml-var
objectid>.  But if I try to reference something in G from B, for instance, I
get a Zope error.

I'm not fully up to speed on the idea of namespaces, but I get the feeling
that this is the source of my problems.  Unfortunately, I'm not sure how
force a reference to something in a different namespace using only its
object id (that is, without having to reproduce the full url path).  Could
someone enlighten me?


2. Looping a lines property

I've been trying to use the <dtml-in> loop structure to go through the entry
in an custom ZClass object's lines property.  But I'm not sure of the syntax
(I've looked through most of the documentation and can't find more than a
minimal description on pg. 44 of the Zope Conten Manager's Guide), and what
I've tried so far isn't working.

I can access individual line items using <dtml-var "objectid.linesid[n]">,
but was hoping to avoid having to create an increment variable for n, test,
increment, etc., since the <dtml-in> structure looked so slick.

What I'm trying to do is to maintain a list of object ids in an object's
lines property and then generate links (<a href=>'s) from the list.  So, I
could also use some direction in using the referenced object id in the lines
property to access its properties (title, mostly).


Thanks very much for any assistance.

Chris Fassnacht