Syntaxerror unexpected token. Uncaught syntaxerror: unexpected token 'else'. error: syntaxerror: json parse error: unexpected eof (-2700). unexpected token '<' modx. syntax error, unexpected token "foreach".