Hi
Does ditto accept a call to order by menu index? I’d expect something like:
&orderBy=`menu_index ASC`
But this doesn’t seem to work, and the ditto documentation doesn’t seem to list what it does accept.
Thanks for any help,
Jim
ditto can sort by each ressource-field and also by TVs
-
☆ A M B ☆
- 24,524 Posts
I don’t see how it could be much clearer, the orderBy parameter is fed straight to the sql query.
ORDER BY fieldname ASC/DESC
is pretty basic sql.
http://www.w3schools.com/PHP/php_mysql_order_by.asp
Thanks all, that resolved my problem. I didn’t find the ditto doc very helpful, as I don’t use SQL much and I don’t know the db field names MODx uses. It might be helpful to show the most common examples in practice. Many MODx users probably know even less than me about databases and SQL, as it is so easy and clean to develop with it, so I would say documentation would ideally require no prior knowledge for the user to understand.
Hope this is helpful - ditto is great and I don’t mean any disrespect to the documentation, just perhaps flagging that users will be at least as ignorant as me!