We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18905
    • 3 Posts
    I’m a newcomer to Modx so this is probably something very simple Im overlooking but I’ve been banging my head against this all morning and haven’t found an answer in any of tutorials or topics here so Im hoping someone can help.

    Heres the ditto call:
    [[Ditto? &parents=`9` &tpl=`NewsItem` display=`all` dateSource=`pub_date` sortBy=`pub_date` sortDir=`DESC` depth=`5` &debug=`1`]]
    9 is the id of the parent document of the children I want to display and this code is on page 9.

    Attaching the debug file as well.

    From what I can tell, the snippet is treating the call as if I hadnt sent the sortBy variable to it. I know there’s an issue with blank publish dates so I have confirmed that all documents have a publish date. The date also shows up correctly on the page, it just doesn’t sort by it.

    Any ideas, much appreciated.
      • 4310
      • 2,310 Posts
      I think it should be `publishedon` rather than `pub_date` throughout your snippet call.
        • 18905
        • 3 Posts
        Tried swapping to `publishedon` but no change. It does seem like Ditto is ignoring my sortBy and SortDir declarations and just resorting to default.
          • 36592
          • 970 Posts
          [[Ditto? &parents=`9` &tpl=`NewsItem` display=`all` dateSource=`pub_date` sortBy=`pub_date` sortDir=`DESC` depth=`5` &debug=`1`]] 
          

          You forgot almost all ’&’ in fornt of parameter names like &dateSource=`pub_date`.
            • 18905
            • 3 Posts
            That was it. Damn rookie mistake, at least I wont be making that one again.

            Thanks for the help!