0

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?

Peter Kraume
  • 3,577
  • 2
  • 21
  • 39
Dennis
  • 5
  • 4

1 Answers1

1

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)]
Peter Kraume
  • 3,577
  • 2
  • 21
  • 39
  • There is a syntax error... Before `&&` is a closing bracket that is never opened. But IMO the first two conditions have to be combined in normal brackets, otherwise the part to the right of the '&&' 'would only be linked to the condition directly to the left of it and only the evaluation of the two would be ORed with the foremost part – Julian Hofmann Oct 13 '21 at 07:36
  • Should it look something like this? ```[(traverse(request.getQueryParams(), 'tx_news_pi1/news') > 0 && (123 in tree.rootLineIds || 456 in tree.rootLineIds)) || (traverse(request.getQueryParams(), 'tx_news_pi1/news_preview') > 0 && (123 in tree.rootLineIds || 456 in tree.rootLineIds))]``` – Dennis Oct 13 '21 at 07:39