#109976TypoScript dataWrap or insertData with placeholder "{field:...]" and accolade doesn't work as expected
Description
With this TypoScript:
page {
headerData.10 = TEXT
headerData.10.dataWrap (
<style>
:root, ::before, ::after {
--clr-main: {field:uid};
--clr-secondary: {field:title};
}
</style>
)
}
the generated code doesn’t work as expected because of the first accolade wich is not a place holder, the result is:
<style>
:root, ::before, ::after ;
--clr-secondary: Accueil;
}
</style>
instead of:
<style>
:root, ::before, ::after {
--clr-main: 112;
--clr-secondary: Accueil;
}
</style>
result is the same with insertData:
page {
headerData.10 = TEXT
headerData.10.value (
<style>
:root, ::before, ::after {
--clr-main: {field:uid};
--clr-secondary: {field:title};
}
</style>
)
headerData.10.insertData = 1
}
the problem comes from the first accolade in text “ { “ which is interpreted as a placeholder.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Related issues 1
History 3
-
Christian Kuhn changed Related to #23762 <span data-processor="relativetime" data-value="2026-06-04T17:57:30+00:00" > 06/04/26, 17:57 </span>
-
Christian Kuhn commented and changed status
NewClosed <span data-processor="relativetime" data-value="2026-06-04T17:58:28+00:00" > 06/04/26, 17:58 </span>Thanks for the report.
This is unchanged behavior in all versions including v13 and v14. Note this is not related to the TypoScript parser: the curly braces survive parsing of the multiline ( … ) assignment just fine. The substitution happens at render time in ContentObjectRenderer::insertData(), which treats the next { as the start of a placeholder and consumes everything up to the next }. Content that cannot be resolved is replaced with an empty string, which is also covered by existing tests. There is no escaping mechanism for literal curly braces, and the related feature request #23762 asking for one was rejected back then.
We will not change this at least for now: any heuristic to leave “non-placeholder” braces alone would change documented stdWrap behavior with breaking potential for existing setups.
The workaround posted by Anton is the way to go: keep literal braces out of the dataWrap value, for example by moving them to a wrap3. Alternatively, literal braces can be produced via LOAD_REGISTER and {register:openCurl} / {register:closeCurl}.
If you feel a hint on this limitation is missing in the TypoScript reference for dataWrap / insertData, please open an issue at https://github.com/TYPO3-Documentation/TYPO3CMS-Reference-Typoscript (and link to this issue for reference), so the documentation team can pick it up.
Closing as won’t fix.
IMHO this is a duplicate of #23762.
There is currently no escaping mechanism for literal
{and}insidedataWrap. The documented workaround is to restructure the TypoScript so that those braces are not inside thedataWrapstring – for example, by using aCOAto assemble the parts, or by placing the CSS block’s outer braces in awrap3and processing only the variable content withdataWrap.Example with
wrap3: