Is this possible with revolution?
To use several id's with different outputs in 1 call?
Like:
When id=1 then=pizza or id=2 then=hotdog or id=22 then=dog else=beer
Evolution user, I like the back-end speed and simplicity

try this one:
<?php
//[[caseChunk? &subject=`[[*id]]` &case1=`1:@CODE:Pizza` &case2=`2:@CODE:Hotdog` &case3=`22:@CODE:Dog` &default=`@CODE:Beer`]]
foreach ($scriptProperties as $property => $case){
$case = explode (':',$case);
if ($property == 'default'){
$default = $case[0] == '@CODE' ? $case[1] : $modx->getChunk($case[0],$scriptProperties);
}elseif (count($case)>1){
if ($subject == $case[0]){
return $case[1] == '@CODE' ? $case[2] : $modx->getChunk($case[1],$scriptProperties);
}
}
}
return $default;
call it this way:
[[caseChunk?
&subject=`[[*id]]`
&case1=`1:@CODE:Pizza`
&case2=`2:@CODE:Hotdog`
&case3=`22:@CODE:Dog`
&default=`@CODE:Beer`
]]
[ed. note: Bruno17 last edited this post 14 years, 6 months ago.]
Thankz!! Works great, also with calling chunks
(still a Rev rookie)
[ed. note: fourroses666 last edited this post 14 years, 6 months ago.]
Evolution user, I like the back-end speed and simplicity
