[Zope] TAL: getting container of template

Mike Renfro renfro@tntech.edu
Tue, 3 Sep 2002 09:17:25 -0500


On Mon, Sep 02, 2002 at 10:16:49PM +0200, Jochen Haeberle wrote:

> But I would like to get the parent or container of the actual
> template to build a independent navigational structure. As I know
> where the template resides this would be very helpful (my users
> access the site in question aas host.domain.com, But I am working
> and testing it as anotherhost.domain.com:8080/Folder I am trying to
> build a navigation that fits both).

The setup I've documented at http://www.zope.org/Members/mwr/ somewhat
fits your description -- I've just verified that it does work if I use
the normal virtual host namespace, or the literal
hostname:portnumber/folder/ namespace.

The first howto (python_zpt_sitemap) is my current setup, though I
have some emails from folks on things to be changed. The second howto
(python_zpt_sitemap_zen) has much better Python code, but I've not yet
finished the ZPT for that version. My suggestion for a quick fix would
be to use the second howto's code, change the last lines to return a
list of objects instead of a dictionary, and then use the ZPT from the
first howto.

-- 
Mike Renfro  / R&D Engineer, Center for Manufacturing Research,
931 372-3601 / Tennessee Technological University -- renfro@tntech.edu