Cast Iron Coding, Inc

TYPO3 Admin's Corner

Click here to return to the TYPO3 Admin's Corner

Stay Connected

Complete the form below to sign up for the CIC newsletter. We send out about one message each month and we do our best to make sure it's full of useful information about TYPO3. We'll never share your email address with a third-party and should you ever change your mind, unsubscribing is a breeze.
TypoScript Techniques

Properly Setting XHTML Document Type and Removing the XML Prologue

 

Properly setting up the document type in the TypoScript configuration is important because it instructs TYPO3 how to transform content into markup. Although the XML prologue is technically the correct way to declare an XHTML document, Internet Explorer chokes on the prologue and renders the page in quirks mode rather than the standards mode we require when XHTML is our goal.

The TYPO3 page.config.doctype property allows us to set the doctype with one of several abbreviations that TYPO3 understands by using a string that designates that doctype. If none of those doctypes are the one we want (which is a rare situation) we can set the doctype we want in the property as well. The abbreviations TYPO3 recognizes are (this comes straight from the TSref link below):

"xhtml_trans" for XHTML 1.0 Transitional doctype.

"xhtml_frames" for XHTML 1.0 Frameset doctype.

"xhtml_strict" for XHTML 1.0 Strict doctype.

"xhtml_basic" for XHTML basic doctype.

"xhtml_11" for XHTML 1.1 doctype.

"xhtml_2" for XHTML 2 doctype.

"none" for NO doctype at all.

Also in the link above is another property: xmlprologue. By setting page.config.xmlprologue = none, we tell TYPO3 to hide the XML prologue, and we preserve standards mode in IE.

Posted on Friday, October 06, 2006 at 04:17 PM.