TypoScript Syntax

1.1.1. What is TypoScript?

Since people are generally confused about what TypoScript (TS) is, where it can be used and has a tendency to think of it as something complex this document has been written to clearly explain these issues.

First lets start with some basic truths:

  1. TypoScript is a syntax for defining information in a hierarchical structure using simple ASCII text content.

This means that:

  1. TypoScript itself does not "do" anything - it just contains information.

  2. TypoScript is only transformed into function when it is passed to a program which is designed to act according to the information in a TypoScript information structure.

So strictly speaking TypoScript has no function in itself, only when used in a certain context. Since the context is almost always to configure something you can often understand TypoScript as parameters (or function arguments) passed to a function which acts accordingly (eg. "background_color = red"). And on the contrary you will probably never see TypoScript used to store information like a database of addresses - you would use XML or SQL for that.

PHP arrays

In scope of its use you can also understand TypoScript as a non-strict way to enter information into a multidimensional array. In fact when TypoScript is parsed that means it is transformed into a PHP array! So when would you define static information in PHP arrays? You would do that in configuration files - but probably not build your address database!

This can be summarized as follows:

  1. When TypoScript is parsed it means that the information is transformed into a PHP array from where TYPO3 applications can access it.

  2. So the same information could in fact be defined in TypoScript or directly in PHP; but the syntax would be different for the two of course.

  3. TypoScript offers convenient features which is the reason why we don't just define the information directly with PHP syntax into arrays. These features include a relaxed handling of syntax errors, definition of values with less language symbols needed and the ability of using an object/property metaphor etc.

For more details see the bottom of the next page.

To top


Valid XHTML 1.0!