
Do you train Kung Fu?
Or know someone who does?
Then check out KungFuPeople.com
Mobile version of this page
Previous:
Dan Heller's Photos of Italy
Next:
Breaking usability principles for usability
TAL here hack in Plone
More crappy album covers
Tip: Printer friendly pages with Page Templates in Zope
Interview with Varg Vikernes
Kalle Kappner - Opeth and Pain of Salvation piano tribute
Orphaned Land - Jewish Muslim Metal
Dan Heller's Photos of Italy
Next:
Breaking usability principles for usability
Related blogs
The "omit-tag" tagTAL here hack in Plone
More crappy album covers
Tip: Printer friendly pages with Page Templates in Zope
Interview with Varg Vikernes
Kalle Kappner - Opeth and Pain of Salvation piano tribute
Orphaned Land - Jewish Muslim Metal
Related by category
DOCTYPE in PageTemplates with METAL
9th of February 2004
For the record, this is how to include a DOCTYPE declaration in Zope when you use PageTemplates with METAL.
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"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
</metal:block>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
...
</html>
</metal:block>
<?xml version="1.0"?>
<metal:block define-slot="doctype">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
</metal:block>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
...
</html>
</metal:block>
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"?>
...etc
instead -- no newline between the end of metal:block and the beginning of the xml processing directive.