Why won't Ditto/Wayfinder sort properly?

This question is asked so often on the MODx forums that I created this page so I wouldn't have to keep typing in the answer.

MySQL version 5.0.51 has a bug related to sorting that has bitten a number of CMS platforms. In Wayfinder, the menu index is ignored, in Ditto, things aren't always sorted the way you want them to be. Generally, the items are sorted by document ID. This means that they end up being displayed in the order they were created rather than however you specified in your snippet tag.

There are essentially three solutions:

  • Get your host to update the MySQL version to at least 5.0.52.
  • Recreate the documents in the order you want them to appear. This can be done by duplicating them all in the correct order, deleting the originals, and renaming them to the original names.
  • Go into the snippet code, find the MySQL query statement, and remove the "GROUP BY" clause. This is what I've done while waiting for a MySQL upgrade.

 

My book, MODX: The Official Guide - Digital Edition is now available here. The paper version of the book is available from Amazon.

If you have the book and would like to download the code, you can find it here.

If you have the book and would like to see the updates and corrections page, you can find it here.

MODX: The Official Guide is 772 pages long and goes far beyond this web site in explaining beginning and advanced MODX techniques. It includes detailed information on:

  • Installing MODX
  • How MODX Works
  • Working with MODX resources and Elements
  • Using Git with MODX
  • Using common MODX add-on components like SPForm, Login, getResources, and FormIt
  • MODX security Permissions
  • Customizing the MODX Manager
  • Using Form Customization
  • Creating Transport Packages
  • MODX and xPDO object methods
  • MODX System Events
  • Using PHP with MODX

Go here for more information about the book.

Thank you for visiting BobsGuides.com

  —  Bob Ray