Attention
TYPO3 v12 has reached end-of-life as of April 30th 2026 and is no longer being maintained. Use the version switcher on the top left of this page to select documentation for a supported version of TYPO3.
Need more time before upgrading? You can purchase Extended Long Term Support (ELTS) for TYPO3 v12 here: TYPO3 ELTS.
Code blocks
Curly braces can be used to structure identifier paths in a more efficient way: Without repeating upper parts of a path in each line. This allows nesting.
Example without braces:
myIdentifier = TEXT
myIdentifier.stdWrap.field = title
myIdentifier.stdWrap.ifEmpty.data = leveltitle:0
This can be written as:
myIdentifier = TEXT
myIdentifier {
stdWrap.field = title
stdWrap.ifEmpty.data = leveltitle:0
}
Curly braces can be nested to further improve readability. This is also the same as above:
myIdentifier = TEXT
myIdentifier {
stdWrap {
field = title
ifEmpty {
data = leveltitle:0
}
}
}
Some rules apply during parsing:
- Everything on the same line after the opening
{and closing}brace is considered a comment, even if the comment markers#,//and/* ... */are missing. -
The closing brace
}must be on a single line in order to close a block. The following construct is invalid, the closing brace is interpreted as part of the value, so the TypoScript and TSconfig backend modules will mumble with a "missing closing brace" warning:Extension examples, file Configuration/TypoScript/Syntax/CodeBlockInvalidClosingBrace/setup.typoscriptmyIdentifier = TEXT myIdentifier { value = bar }Copied! -
Conditions can not be placed within blocks, they are always "global" level and stop any brace nesting. The following construct is invalid, the TypoScript and TSconfig backend modules will mumble with a "missing closing brace" warning:
Extension examples, file Configuration/TypoScript/Syntax/CodeBlockInvalidCondition/setup.typoscriptmyIdentifier = TEXT myIdentifier { value = foo [frontend.user.isLoggedIn] value = bar [end] }Copied! -
Nesting is per-file / per-text-snippet: It does not "swap" into included files. This was the case with the old TypoScript parser. It has been a nasty side-effect, leading to hard to debug problems. File includes with
@importand<INCLUDE_within curly braces are not relative (anymore). A construct like this is invalid, the TypoScript and TSconfig backend modules will mumble with a "missing closing brace" warning:TYPOSCRIPT: Extension examples, file Configuration/TypoScript/Syntax/CodeBlockInvalidCondition/setup.typoscriptmyIdentifier = TEXT myIdentifier { @import 'EXT:my_extension/Configuration/TypoScript/bar.typoscript' value = foo }Copied!