When Ditto list pages they are ordered oldest (on top) to newest (on bottom). Is there a way I can rearrange this so the newest page is listed first.
[[Ditto? &dateFormat=`%c` &tpl=`ditto_blog &summarize=`all` &extenders=`summary`]]
You can change sort order by using &orderBy parameter.
But I think its default is &orderBy=`createdon DESC`, so the newest comes at the top of the output listing...
Are you possibly using MySQL 5.0.51 ?
-
MODX Staff
- 12,272 Posts
Moving to appropriate topic.
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
I am using MySQL v5.0.27. It looks like I should update that. I just realized that when I created all the pages I created the newest first and the oldest last. Could I use the publish date input and then sort by pub_date?
Yep. Use &sortBy (field: createdon, pub_date, editedon etc.) + &sortDir (ASC or DESC)
I ended up sorting by menuIndex, and now everything is working great. Thanks for your help.
How do I sort alphabetically??? I found the question asked once, but never answered. I’ve tried:
[!Ditto? &parents=`12` &total=`40` &orderBy=`title DESC` &tpl=`resourceTpl`!]
It’s sorting differently from the default, but it’s not alphabetical.