[ZPT] Container / here confusion

Nick Dimmock nick.dimmock at northampton.ac.uk
Fri Sep 24 05:57:35 EDT 2004


Hi - I'm working through my first Zope site and trying to stick to ZPT. 
The setup I have at the moment has an index_html in the root folder, 
and I then want each subfolder to have either a pageCode or pageText 
template. If pageCode exists, the root index_html includes it. 
Otherwise pageText is used, either in the current folder or further up 
the path.

So I want to check for the existence of pageCode in the current folder, 
but I'm having problems doing that. I've boiled the problem down to a 
simple conditional test. This is in my root index_html:

<div tal:condition="here/pageCode">I have code in here!</div>
<div tal:condition="container/pageCode">I have code in container!</div>

Both these divs are rendered even if the current folder has no pageCode 
template. I assume this is because they are both traversing up the path 
until they find a pageCode. How do I limit the check to the current 
folder? For example, if I browser to "/packs/search/" I want to check 
for a pageCode template in the search folder alone. Is this problem 
because my index_html is located in root? I want to keep that setup so 
that certain users only have to edit a pageText template that will just 
contain ReST content...

Any pointers gratefully received -

Nick



More information about the ZPT mailing list