Typo3 > 9.4 - Nested conditions in Typoscript available?

533 Views Asked by At

does anyone know if nested conditions are possible in Typo3>9.4?

I didn't find anything in the internet or in the documentation of the site itself.

Currently I try it like this:

[2 in tree.rootLineIds]
  [applicationContext == "Development"]
    [loginUser('*') && page["uid"] in [13]]
      ....
    [end]
  [end]
[end]

But it seems not to work. Does anyone have a tip for me? I would be very grateful for it.

2

There are 2 best solutions below

0
On

Nesting of TS Conditions is IMO still not possible (Haven't found anything about it in the docs - neither that it works nor that it doesn't work).

Maybe combining conditions can help you.

0
On

Since TYPO3 v12, a rudimentary nesting is possible, see https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/Configuration/TypoScript/Syntax/FileImports/Index.html.

But only one level of nesting is possible per file. Example:

[frontend.user.isLoggedIn]
    @import './userIsLoggedIn.typoscript'
[END]

In file userIsLoggedIn.typoscript, you are able to use TypoScript conditions, too. Thus, there's the second level of nesting.