I have a split Navigation: Topmenu - Submenues, and am using Wayfinder and UltimateParent to get those.
[tt]
1_Home
A_Subpage
B_Subpage
2_Contact
3_OtherStuff
C_Subpage
D_Subpage
[/tt]
My call for the Topmenu is:
[!Wayfinder? &startId=`0` &level=`1` &outerClass=`nav_main` !]
The Submenues:
[!Wayfinder? &startId=`[[UltimateParent]]` &outerClass=`nav_sub` !]
This is all working very well, until I hit a page without subpages (« 2_Contact »).
That will produce an error:
[tt]
« 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 ’3) GROUP BY sc.id ORDER BY sc.menuindex ASC’ at line 1 »
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 `modx`.modx_site_content sc LEFT JOIN `modx`.modx_document_groups dg ON dg.document = sc.id WHERE sc.published=1 AND sc.deleted=0 AND (sc.privateweb=0) AND sc.hidemenu=0 AND sc.id IN (,3) GROUP BY sc.id ORDER BY sc.menuindex ASC ;
[/tt]
Can I prevent Wayfinder from making the db-call, when there are no subpages?
Thanks,
Sascha