[Zope] Creating a menu for each page

Roddy rvagg@grug.une.edu.au
Wed, 16 Feb 2000 14:01:32 +1100 (EST)


I'm quite new to Zope and have been trying to migrate a site from a bunch
of Java servlets to it but am getting bogged down trying to get a handle
on DTML. The DTML guide isn't exactly helpful since it jumps straight into
it without giving many examples.
Anyway, the problem! I've been trying to find the answer in the
documentation (how-to's and tips etc.) but can't quite do what I need to
do.
I have a site that is probably going to get very complex but stems from
about 5 main sections. I have my main sections as links on the header to
be used all over the site so I don't need to provide an extra menu
containing them, but I do need to create a sub menu once inside each of
the sections. So if I have the following site structure:

Root
	Section1
		Section1.1
			Section1.1.1
				Section1.1.1.1
				....
			Section1.1.2
			Section1.1.3
		Section1.2
		Section1.3
		Section1.4
	Section2
	Section3
	Section4

You get the idea...

If I enter section 1 then I get a menu on the side of the page that will
look like the following:

Section1
  Section1.1 <-- link
  Section1.2 <-- link
  Section1.3 <-- link
  Section1.4 <-- link

(ie: it has a title of the section followed by links to each of the
sub-sections)

Once I'm in a Section1.1 I would get:

Section1
  Section1.1 <-- link (bold)
    Section1.1.1 <-- link
    Section1.1.2 <-- link
    Section1.1.3 <-- link
  Section1.2 <-- link
  Section1.3 <-- link
  Section1.4 <-- link


Then once in Section 1.1.1 I would get:

Section1
  Section1.1 <-- link (bold)
    Section1.1.1 <-- link (bold)
    Section1.1.2 <-- link
    Section1.1.3 <-- link
  Section1.2 <-- link
  Section1.3 <-- link
  Section1.4 <-- link

(ie: I get no more of the structure in the menu, only the first 3 levels).

So, I need to be able to create this tree from anywhere in the site, this
will probably be in my global standard_html_header so it needs to work all
around. I have my folders all setup to try and get this to work but I just
can't get enough of the information I need and acquisition is driving me
nuts! (I can't just be a _normal programmer_, I have to worry about
variables all the way up the tree!)

A complication is also that I would like it to be able to determine the
root folder of the site, not the root folder of the instalation. That is,
so it will work even if I have '/Zope/' at the start of the URL or if I
move the whole thing down into itself (not sure why I would do this, but
you never know!). I have tried putting a 'property' in the top to indicate
that's the root folder but acquisition causes this property to be
accessable all the way down so if I test for it it's always there (growl).

I have figured out that I need to be using the <dtml-in PARENTS> and have
been using that to try and get what I want but this seems too complicated
for a beginner and I need help!

I imagine that when I start to get a bit more of a handle on DTML then
things will become a little more easy but right now I'm wondering if I'm
doing the right thing by moving to Zope.

Any help would be greatly appreciated!
Thanks,
 -- Roddy


---
Roddy Vagg
Programmer, Web Developer
Systems Administrator
Cooperative Research Centre for Cattle and Beef Quality
(and) Total Genetic Resource Management (TGRM)
Ph: (+61)267733978
---