[ZPT] page templates with unbalanced tags

Adam genericplayer at uoxng.org
Mon May 3 17:31:51 EDT 2004


On Mon, May 03, 2004 at 02:50:34PM -0500, Ian Bicking wrote:
> 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>

Ok, this seems like what I need, except for one problem.  It looks like
I can only use metal in a tag that has an open and close tag.  The first
line in my header isn't the <html> tag, its my doctype declaration.  Can
you use metal on its own like you can with tal (<tal:blah blah>
</tal:blah>)?

Thanks
Adam



More information about the ZPT mailing list