[Zope] Using a template for all pages, or calling dtml as a function, or perhaps switch to Zpt ??

Max M maxm@mxm.dk
Wed, 12 Jun 2002 09:52:03 +0200

I have a site where i want to use the same template for all the pages. 
Lets say that I have the following structure:

    <dtml-var primary_content>
    <dtml-var secondary_content>
I then want to use this template for all my pages. Most of my products 
will them implement "primary_content()" and "secondary_content()" 
methods. If a product hasn't implemented one of the methods, it just 
finds it from somewhere up the aquisition (aq) path

So far so good.

My problem is that it seems that I have to define "index_html" in every 
product for this to work.

If I just put an "index_html" in the root of my aq path zope will 
traverse it's way up to it allright, but naturally won't find the 
objects "primary_content()" and "secondary_content()" methods. So the 
view is wrong.

If I create a simple dtml attribute that looks like:

    <dtml-var "aq_parent.index_html(None, _)"> to call the aquired 
index_html within the current namespace, it doesn't work either.

I want to use this type of layout in a site using a lot of products, so 
putting all the index_html code inside each product is A Bad Thing for 
many reasons.

Has anybody got an idea as to how I can approach this? Perhaps by using 
Zpt ?

Isn't it possible to call the index_html like a function from within the 
current namespace ?? If so, isn't index_html(None, _) the right way to 
do it?

regards Max M


"Sorry I would Really Like To Help More On This Project,
But Am To Busy Doing Paid Work On A Tight Deadline"
    Max M