Hello
the following code produces kind of a weird result:
// language is not set
if (!isset($lang)) {
// get language from language container - tv is @INHERIT
$tv = $modx->getTemplateVarOutput(array('tv-lang'), $modx->documentIdentifier);
$lang = $tv['tv-lang'];
}
if (!isset($box)) return '';
/*if ($lang == 'de') {
$id = 14;
} elseif ($lang == 'en') {
$id = 91;
} elseif ($lang == 'fr') {
$id = 92;
} else {
$id = 'error';
}*/
switch ($test) {
case 'de':
$id = 14;
break;
case 'en':
$id = 91;
break;
case 'fr':
$id = 92;
break;
}
return 'Values: ' . $id . ' || ' . $lang . ' || ' . $modx->documentIdentifier;
//return "[!WebLogin? &tpl=`tpl-login-".$lang."`&loginhomeid=`".$id."`&logouthomeid=`".$id."`!]";
neither the if/elseif nor the switch stuff works - I’m not getting a valid id back; However, on my page, the $lang variable return e.g. ’de’.
Hope somebody could please tell me what I’m doing wrong!?
Thank you in advance for your input.