[Typo3] Why I this code invalid?

Michael Baker mbaker at pobox.com
Sun Oct 2 18:06:44 CEST 2005



Martin Bless wrote:

>On Sat, 1 Oct 2005 12:07:15 -0700, Christopher <bedlamhotel at gmail.com>
>wrote:
>
>  
>
>>To solve problems with invalid html, your only recourse is to learn
>>how to write valid html instead.
>>    
>>
>
>Yes, sure. But in this case I'm asking: Why does *Typo3* produce this
>invalid code?
>
>I should have taken a better - that is to say - simpler example. Let's
>say all there is in TS is:
>
># Default PAGE object:
>page = PAGE
>page.10 = TEXT
>page.10.value = HELLO WORLD!
>
>page.20 = TEXT
>page.20.value = <a href="http://validator.w3.org/check/referer"
>target="_blank">VALIDATE</a><br />
>
>To find at:
>http://www.magno-sanol.de/index.php?id=719
>
>It's just one TEXT element added to the Typo3 default template for a
>new website.
>
>Nevertheless, the Typo3 generated output produces 3 errors, all of
>them in the header or body tag surrounding the actual content.
>
>One thing is, I think, this shouldn't happen.
>
>Q: And on the other hand, how can I fix it?
>  
>
If you view the page source for 
http://www.magno-sanol.de/index.php?id=719 you will see that it starts 
with the doctype:

<!DOCTYPE html
    PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

But the rest of the page is xhtml, so you need the xhtml doctype.  A 
search of google (typo3 doctype) brings up at the top of the list a page 
[1] that includes: "Next step is to make *TYPO3* generate an XHTML 
*doctype* in the output."  Visiting the page shows that you need to add

page.config.doctype = xhtml_trans

to your typoscript setup.

Michael.

[1] 
http://typo3.org/documentation/document-library/doc_tut_templselect/Adding_XHTML_complia/




More information about the TYPO3-english mailing list