DOCTYPE in PageTemplates with METAL

09 February 2004   1 comment   Zope

Powered by Fusion×

For the record, this is how to include a "DOCTYPE declaration"n: in Zope when you use "PageTemplates with METAL"n:

In your standard template object (e.g. StandardLook.zpt):

<metal:block define-macro="standard">
<?xml version="1.0"?>
 <metal:block define-slot="doctype">
   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="" xml:lang="en" lang="en">

This site is not XHTML valid (yet), but W3C has the validator to use.


Thanks for a great bit of advice! I find that some parsers (notably W3C's validator) get a little confused by the empty 1st line that this results in. I fixed it by doing

<metal:block define-macro="foobar"
><?xml version="1.0" encoding="utf-8"?>

instead -- no newline between the end of metal:block and the beginning of the xml processing directive.
Thank you for posting a comment

Your email will never ever be published

Related posts

Dan Heller's Photos of Italy 08 February 2004
Breaking usability principles for usability 10 February 2004
Orphaned Land - Jewish Muslim Metal 08 December 2009
Kalle Kappner - Opeth and Pain of Salvation piano tribute 19 August 2008
Interview with Varg Vikernes 01 July 2008
Tip: Printer friendly pages with Page Templates in Zope 24 March 2008
More crappy album covers 06 August 2006
TAL here hack in Plone 28 April 2005
The "omit-tag" tag 07 July 2003