[Zope] container id

Casey Duncan c.duncan@nlada.org
Mon, 22 Oct 2001 12:47:07 -0400


On Monday 22 October 2001 12:27 pm, Tony Flanagan allegedly wrote:
> Can anybody help with a problem I'm having. I've just started using Zope
> and I'm developing a reasonably simple intranet. The point at which I'm
> having problems is trying to write a dynamic navigation bar. I have a
> dtml method called from my standard header which will display certain
> blocks of dtml dependent on the id of the containing folder. This works
> fine when the documents are contained in a one folder system, but I have
> a folder with sub-folders and I would like to be able to display some
> dtml based on the main folders id. Sure thats clear but hoping for a
> response so.....

You probably should set a property on the folder used to contain the 
navigation. Something like "site_section". This will then propagate down to 
lower level objects via acquision.

Otherwise, assuming the "section" folder is always one level below the root, 
you could use REQUEST.steps to get it's id. REQUEST.steps contains a list of 
objects traversed to get to the published object.

hth,
/---------------------------------------------------\
  Casey Duncan, Sr. Web Developer
  National Legal Aid and Defender Association
  c.duncan@nlada.org
\---------------------------------------------------/