0

I have created a custom NodeType "Events" with a custom TS2 file in Neos, but I guess it is more a general question about Typoscript 2.

prototype(Some.Namespace:Events) < prototype(TYPO3.Neos:Document) {
    ...

    sortOrder = ${request.arguments.sortOrder  == 'asc' ? 'asc' : 'desc'}
    otherVariable = ${sortOrder}

    ...
}

Of course this is simplified to focus on the issue:

I want to assign the value of the variable sortOrder (which is "asc" or "desc") to another variable named otherVariable.

How can I do that? I cannot access the value using ${sortOrder}, which returns always NULL.

Leif
  • 1,076
  • 10
  • 16

1 Answers1

2

All you need to do is add this as below and {otherVariable} in your fluid template will work. Flush cache in case you sill have NULL.

sortOrder = ${request.arguments.sortOrder  == 'asc' ? 'asc' : 'desc'}
otherVariable = ${this.sortOrder}
k.tarkin
  • 726
  • 3
  • 9
  • I added somewhat similar question about parent variables: http://stackoverflow.com/questions/42930060/fusion-typoscript-2-how-to-access-a-variable-from-a-parent-object – Leif Mar 21 '17 at 14:51