We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12556
    • 103 Posts
    By default Ditto displays the newest documents first.  I would assume it does this by sorting the documents by ID in descending order.  I want to sort then in ascending order.  I’ve found the $orderBy parameter but this doesn’t appear to be something that I can pass in the snippet call.  Is there an easy way to do this or do I need to edit the SQL in the snippet or something?  Thanks!

    Edit: I just searched for DESC in the snippet and changed it to ASC and that fixed the problem but it just occurred to me that doing that means that Ditto calls elsewhere that I want to be sorted in descending order will now be messed up so this isn’t a good solution.
      • 7231
      • 4,205 Posts
      If you are using Ditto 2.1+ then use the &orderBy parameter:
      &orderBy=`pagetitle ASC`
      If using an older version of Ditto use:
      &sortBy=`pagetitle` &sortDir=`ASC`
        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

        Something is happening here, but you don't know what it is.
        Do you, Mr. Jones? - [bob dylan]
        • 12556
        • 103 Posts
        Sweet. Thanks! The $ in the documentation threw me. I thought it was just an internal PHP variable and not a parameter. ’Preciate it!