Finding TypoScript errors.

Posted: February 16th, 2012 | Author: | Tags: , | 10 Comments »

When you work on TypoScript templates in TYPO3, errors might show up in the TypoScript Object Browser. Within the error messages you’ll see a more or less detailed error description with the related line number. Within most setups these line numbers won’t relate to any of your sys_template records or TypoScript files directly. But they still provide value if you know how they help to find the right spot. As it’s not too obvious how to find the right spot I’ve created a little screenshot series to guide you to the broken spots in your templates.

So that’s what you might see in your TypoScript Object Browser:

The error message from your TypoScript Object Browser might look like this.

 Switching from there to the Template Analyzer:

Switching to the TypoScript analyzer

At the bottom of the Template Analyzer, you’ll find a “Complete TS” section and a link ~which looks like normal text.

And you'll find a link to the fully concatenated TypoScript of your current page.

Clicking on that link will give you the entire concatenated TypoScript and here you’ll also find that the line numbers finally match to the error message.

And you'll find that the line numbers are now what you saw in the error message before (might need some scrolling).

A well hidden gem which works most likely in all TYPO3 4.x versions ;)


Edit: In the meantime, Ingo’s patch made it through the review process. So users of TYPO3 4.7 and above will find a nice and handy “Show details” link next to the error message. Makes it much much faster to find the broken spot. Thanks Ingo :) / (@irnnr)


10 Comments on “Finding TypoScript errors.”

  1. 1 Michael Cannon said at 11:03 am on February 17th, 2012:

    Thank you for writing this all down in one spot. I knew this stuff, but when trying to teach young bucks about it, I’d get tongue twisted.

    Now I guess we don’t have an excuse to keep these errors around any longer.

    Ciao!

  2. 2 Ingo said at 11:20 am on February 17th, 2012:

    So wouldn’t it make sense to link from the error message to that view and the correct line number? :)

  3. 3 tolleiv said at 11:25 am on February 17th, 2012:

    Would make total sense, of course. Feature or Bug ;)

  4. 4 François said at 12:14 pm on February 17th, 2012:

    A typical hidden gem. I discovered it by chance a while ago. I think it was introduced in 4.2 ou 4.3, so it’s definitely available on all supported version.

  5. 5 Fundstücke: Fehler in der TypoScript Syntax finden | TYPO3 Blogger said at 5:30 pm on February 17th, 2012:

    [...] einem Blog Beitrag erklärt Tolleiv Nietsch, wie man Fehler in der TypoScript Syntax finden kann, auch wenn das TypoScript auf mehrere Seiten, [...]

  6. 6 Phil said at 5:56 pm on February 17th, 2012:

    @François It was available since 3.x, but there was no link printed for versions below 4.2.
    So you can use this feature in *all* TYPO3 versions.

  7. 7 Martin Bless said at 11:45 am on February 18th, 2012:

    And it’s available TYPO3 versions before that don’t have that link “show all” yet. I learned that from Steffen Ritter at T3DD10: Click on just one of the offered Typoscript parts offered in the tree at the top of the template analyzer and open it IN A NEW window. Then change the end of the url to “…&template=all” and reload. Damn cool. If I only had known that years before …

  8. 8 Daniel Siepmann said at 3:59 pm on February 18th, 2012:

    A well hidden gem which works most likely in all TYPO3 4.x versions

    I think the Feature “view the complete” exist in all versions higher then 4.3

  9. 9 Ingo said at 9:19 pm on February 19th, 2012:

    http://review.typo3.org/9112 :)

  10. 10 Probleme mit Template - TYPO3 Forum & Portal said at 5:43 pm on March 13th, 2012:

    [...] Hallo, naja, Fehler in deinem TS kann TYPO3 auch von Haus aus erkennen ;-) Finding TypoScript errors. | the fancy part of the web – tolleiv.de [...]