Search code examples
typo3typoscripttx-newstypo3-10.x

Migrate complex TypoScript condition to 10 LTS / 11 LTS


I try to migrate the following condition without success:

[globalVar = GP:tx_news_pi1|news > 0] || [globalVar = GP:tx_news_pi1|news_preview > 0] && [PIDinRootline = 123, 456]

I tried something like this, but none of my attempts seem to work:

[traverse(request.getQueryParams(), 'tx_news_pi1/news') > 0  || traverse(request.getQueryParams(), 'tx_news_pi1/news_preview') > 0] && [123 in tree.rootLineIds || 456 in tree.rootLineIds]

How do i have to write such complex conditions in Symfony Expression Language/TypoScript?


Solution

  • I think you need to write the complete condition into one square brackets expression:

    [traverse(request.getQueryParams(), 'tx_news_pi1/news') > 0 || traverse(request.getQueryParams(), 'tx_news_pi1/news_preview') > 0] && (123 in tree.rootLineIds || 456 in tree.rootLineIds)]