TypoScript If Else

Folgende Beispiel-Zeilen zeigen, wie sich die von Php bekannten if else Abfragen mittels Typoscript umsetzen lassen.

lib.if_else = COA
lib.if_else {
 
  # Example 1
  10 = TEXT
  10.value = if - Condition = true
  10.if {
    value = Wert1
    equals = Wert1
  }
  20 = TEXT
  20.value = else  Condition = false
  20.if {
    value = Wert1
    isInList.Wert1
    negate = 1
  }
 
  # Example 2 - With Variables
  30 = TEXT
  30.value = Variable is true
  30.if {
    value.data = TSFE:fe_user|user|uid
    equals.data = GP:tx_wfqbe_pi1|uid
  }
  40 = TEXT
  40.value = Variable is false
  40.if {
    value.data = TSFE:fe_user|user|uid
    isInList.data = GP:tx_wfqbe_pi1|uid
    negate = 1
  }
 
  # Example 3
  NO.allWrap = XX|XX
  NO.allWrap {
    override = YY|YY
    override.if {
      value = test, test2
      isInList.field = title
    }
  }
 
  # Example 4
  NO.allWrap.cObject = COA
  NO.allWrap.cObject {
    10 = TEXT
    10.value = XX|XX
    10.if {
      value = test, test2
      isInList.field = title
    }
    20 = TEXT
    20.value = YY|YY
    20.if {
      value = test, test2
      isInList.field = title
      negate = 1
    }
  }
}