condition requiredThe value to test, usually a field-getter or alias whose expanded value is matched against each case. Compared with preg_match, so the cases are treated as regular expressions.
case1...caseN optionalA regular expression matched against the condition with preg_match. It matches when the pattern is found anywhere in the condition; anchor with ^ and $ for an exact match. An empty case matches any condition (catch-all). Cases alternate with results and may repeat.
result1...resultN optionalThe output returned when its preceding case matches. _#1 inside the result is replaced by the condition value. To include a literal colon, escape it as #:.
default optionalOptional final value, given as an unpaired trailing parameter. Returned when no case matches. If every parameter after the condition is paired, there is no default and a non-match returns an empty string.
{switch:event:news:News:event:Event:Other}
{switch:user123:^admin:Admin:^user:User:Guest}
{switch:blog:news:News:event:Event:Other}
{switch:anything:no:N::FALLBACK}
{switch:open:open:Status#: _#1:none}
{switch(10:30)^1:morning:afternoon}
{switch:news:news:Section is _#1:Other}