Search code examples
typo3typoscript

Typoscript condition for empty variable


Is there a way to use Typoscript condition to assign a different value to a TypoScript TEXT if a GET variable is empty ?

Something like that :

xxxx.1 = TEXT
[globalVar = GP:print != ""]
xxxx.1.value = Absent
[else]
xxxx.1.value = Present
[end]

Of course here the != "" doesn't work, so what should I use instead ?


Solution

  • Here is an example with "if":

    1 = TEXT
    1 {
        value = Absent
        override = Present
        override.if {
            isTrue.data = GP:print
        }
    }