Search code examples
symfonytypo3conditional-statementstyposcripttypo3-9.x

Why does this TypoScript treeLevel condition (symfony syntax) sometimes not work?


The TypoScript condition:

    page.5 = TEXT
    page.5.value = NOT LEVEL 0
[tree.level == 0]
    page.5.value = LEVEL 0
[END]

Sometimes it results in "LEVEL 0" on subpages and sometimes in "NOT LEVEL 0". I can't recognize a system, it changes sporadically. But it seems to keep the value after a reload and may change it after visiting the root page and clearing the FE cache in between, even though caching is actually disabled:

page.config.no_cache = 1

I thought it could have something to do with that my condition may be wrong (maybe 0 is sometimes interpretet as "false" instead of zero), or a TYPO3 Bug.


Solution

  • In TYPO3 v9, new conditions based on the symfony expression language were introduced. Some of these conditions are not yet working reliably and have to be fixed – especially regarding the rootline/page tree.

    Your problem seems to be related to this issue: https://forge.typo3.org/issues/86837