[Typo3] Why I this code invalid?

Christopher bedlamhotel at gmail.com
Sat Oct 1 21:07:15 CEST 2005


On 01/10/05, Martin Bless <m.bless at gmx.de> wrote:
> Typo3, v3.8
>
> Please try on http://www.sanol.de/index.php?id=2&type=98 and click
> "VALIDATE".
>
> What's happening? When I create that simple website like this
>
> pagep = PAGE
> pagep.typeNum = 98
> pagep {
>   10 = TEXT
>   10.value = Dies wird die Druckversion.<br />
>   20 = TEXT
>   20.value = <a href="http://validator.w3.org/check/referer"
> target="_blank">VALIDATE</a><br />&nbsp;<br />
>
>   30 = TEXT
>   30.value (<br /><pre>
>
> pagep = PAGE<br />
> pagep.typeNum = 98<br />
> pagep {<br />
>   10 = TEXT<br />
>   10.value = Dies wird die Druckversion.&lt;br /&gt;<br />
>   20 = TEXT<br />
>   20.value = &lt;a href="http://validator.w3.org/check/referer"
> target="_blank"&gt;VALIDATE&lt;/a&gt;&lt;br /&gt;<br />&nbsp;<br />
> }
>
> </pre>)
> }
>
> the (Typo3-header-) code doesn't validate to success.
>
> What's wrong? What can I do about it? Firefox tells me it's viewing
> the website in quirksmode.

To solve problems with invalid html, your only recourse is to learn
how to write valid html instead. There is also some problem with the
posted TS. A short (and incomplete) list of problems that I noticed:


HTML:
-- Short version of doctype (this will send browsers into 'quirks' mode)
-- Text occurring in the markup outside any block level element such
as <p> or <div>
-- Closed ('</pre>') without opening it (due to a problem with TS
described below)

TS:
-- Less obvious, but based on the output (the very FIRST output in
your html is "Dies wird die Druckversion"), the TS interpreter
apparently thinks that the TS that's part of TEXT object 30 is
_actual_ TS and not just quoted TS. Presumably it thinks that you've
simply missed a closing } or ) and that it's seeing a whole new TS
object which, since it's got the same numbering system overwrites the
originals. I can't immediately spot the error, though there must be
one, since this works:


page.999 = HTML
page.999 {
  value (
page.998 = HTML
page.998 {
  value (This is a)
}

page.999 = HTML
page.999 {
  value = test
}

)
  value {
    wrap = <pre>|</pre>
  }
}

-Christopher



More information about the TYPO3-english mailing list