Typoscript condition for empty variable

ejoubaud picture ejoubaud · Aug 2, 2012 · Viewed 11.7k times · Source

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 ?

Answer

Shufla picture Shufla · Aug 10, 2012

Here is an example with "if":

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