[ZPT] page templates with unbalanced tags

Ian Bicking ianb at colorstudy.com
Mon May 3 15:50:34 EDT 2004


Adam wrote:
> I am attempting to use page templates to make a site, and I have 3
> elements that I want to include into all my pages.  The header, menu,
> and footer.  The problem is header has an opening html and body tag,
> which zope decides to close on me.  And I can't even use the footer,
> which has the closing body and html tags because zope comlains about me
> trying to close un-opened tags.  Is there some way to tell zope that a
> file isn't "complete" on its own, its intended to be used as part of
> something else, so it doesn't try to make sure its a valid page all on
> its own?

This is where you have to use METAL templates, instead of including 
headers and footers.  It goes something like:

<html metal:define-macro="page">
header stuff...

<tal:block metal:define-slot="body">
this gets replaced...
</tal:block>

footer stuff
</html>



This way you give Zope a fully valid template.  But read up on METAL to 
learn all the details.

   Ian



More information about the ZPT mailing list