What is the best way to debug Typoscript in TYPO3 CMS?
Asked Answered
W

3

22

What is the best way to debug typoscript in the TYPO3 CMS?

Assuming I have a list, which is not displayed - what is the strategy to look for the issue?

Windom answered 11/7, 2011 at 18:46 Comment(0)
A
37

Debugging Typoscript is not the most comfortable task, but there are several possibilities. Here are the most common techniques:

  • Use the TS Object Browser in the backend: Choose the Web > Template module, then pick the page from the pagetree you need to debug. If there are any obvious syntax errors or redundant/missing brackets, an error message will be displayed. Switch between constants and setup and use the search field extensively. In your example, search for the myListview parameter if your TypoScript object is named myListview.
  • Use the Template Analyzer in the backend (also in Template module): It's similar to the Object Browser, but the Template Analyzer gives you valuable insights where in your setup the errors (or warnings) exactly are that have been spotted.
  • Outsource your Typoscript setup (+ constants) to files, then use a syntax highlighter in your favorite text editor. You get a better overview and the highlighting helps to avoid misspellings. For example:
  • Activate the admin panel in the frontend and use the section "TypoScript". It shows you selected rendered (config) values, SQL queries, error messages and more. However, it's not complete and I'm not using it frequently so I am also keen on knowing more about it.
  • Wrap your Typoscript objects with the stdWrap.debugFunc Function or use the build-in debugItemConf method for all MENU objects. Debug output will be seen in the frontend. Read more in the TYPO3 Wiki
  • Most common errors (apart from typos) are wrong file paths, non-existing HTML-templates or missing subparts in modified templates. Also, forgetting to include static templates for an extension might leave the intermediate user puzzled. Just as a starting point :).

Hope that helps, please post any additions into the comments.

Azaleah answered 12/7, 2011 at 22:11 Comment(3)
Netbeans TypoScript plugin is pretty awesomeSovran
One could also use PhpStorm with "TypoScript Plugin" by "sgalinski Internet Services", works pretty good as well.Spacing
I added the PHPStorm option, which I use use, too.Azaleah
S
5

The most important thing is, not to rely on code you found via google. Have a look into TSref and check what is possible.

Just some little additions which are easy to overlook (IMHO):

  • The template analyser has an option: "View the complete TS Listing", so can search in the whole created typoscript! Including conditions.
  • TS Object Browser: you can check conditions to simulate different situations

If you need to debug TypoScript configuration in the backend, go to the "Info"-Modul, select a page in the page tree and then select "Page TSconfig" in the main window. There you will get a info about Page TS Config.

These system extensions are usually installed, but they can be deactivated:

  • tstemplate
  • tstemplate_ceditor
  • tstemplate_info
  • tstemplate_objbrowser
  • tstemplate_analyzer
  • info_pagetsconfig (info modul)
  • tsconfig_help (addition to the info modul)

It may happen, that someone else just deactivated them.

Skardol answered 23/8, 2012 at 7:42 Comment(1)
Your link does not work. Try this docs.typo3.org/m/typo3/reference-typoscript/master/en-usNewsletter
E
-1

SIMPLE: use headerData in typoscript and view source code by this you can debug typoscript.

Eremite answered 2/4, 2014 at 12:27 Comment(1)
This, unfortunately, is not very helpful. What is simple about "using headerData"? How do I "use headerData"? 🤷‍♀️Abscond

© 2022 - 2024 — McMap. All rights reserved.