Hi everybody!
I just got playing with MODx (0.9.5) a few weeks ago, mostly just evaluating its strengths and weaknesses (if any).
Now I’m facing a problem creating a multilingual site and found this topic. I did every step just as it was described to get this thing running, but something is not working.
I noticed that the first posts of this topic are quite old now, so I think the problem is mainly caused by the changes made to the core of MODx since than, probably.
I created the [[SetLangCookie]] snippet and the [*lang*] TV just as Susan was telling. The [[SetLangCookie]] is called on every Language’s main page (is embedded in the page’s content) so I guess this is OK as long as I only want to change the cookie when I change languages. There is a difference between my site and the others described, which consists of the [[WayFinder]] snippet which I am using to create the menus.
I am calling this snippet this way (is embedded in the template I’m using):
[[Wayfinder? &startId=`[*lang*]` &rowTpl=`rowTpl` &hereTpl=`hereTpl` &parentRowHereTpl='parentRowHereTpl' &parentRowTpl=`parentRowTpl` &innerRowTpl=`innerRowTpl` &innerHereTpl=`innerHereTpl` &innerTpl=`innerTpl` &outerTpl=`outerTpl` ]]
The &startId parameter is meant to tell the snippet from where to start parsing the document tree.
The problem itself is that the [*lang*] TV doesn’t return any value, and so MODx dies with a huge error message:
Parse error: parse error, unexpected $ in /var/www/html/aim-solutions.mkweb/htdocs/aim-solutions/manager/includes/tmplvars.commands.inc.php(50) : eval()'d code on line 1
« MODx Parse Error »
MODx encountered the following error while attempting to parse the requested resource:
« Execution of a query to the database failed - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND sc.published=1 AND sc.deleted=0 AND (sc.privateweb=0) AND sc »
SQL: SELECT DISTINCT sc.id,sc.menutitle,sc.pagetitle,sc.introtext,sc.menuindex,sc.published,sc.hidemenu,sc.parent,sc.isfolder,sc.description,sc.alias,sc.longtitle,sc.type,if(sc.type='reference',sc.content,'') as content, sc.template,sc.link_attributes FROM `aim_solutions`.aim_site_content sc LEFT JOIN `aim_solutions`.aim_document_groups dg on dg.document = sc.id WHERE sc.parent = AND sc.published=1 AND sc.deleted=0 AND (sc.privateweb=0) AND sc.hidemenu = 0 GROUP BY sc.id ORDER BY sc.menuindex ASC;
[Copy SQL to ClipBoard]
Parser timing
MySQL: 0.0115 s (6 Requests)
PHP: 0.1233 s
Total: 0.1348 s
From the outputted SQL one can see that the error is caused by
sc.parent = AND
,
sc.parent
not having a value.
Is there somebody, who can say anything about this which would help me pass trough this?
Any help would be greatly appreciated.
Thanks