We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26178
    • 32 Posts
    Hello everybody.

    I’ve got a problem...
    Is there any way to call ditto to have my documents multisorted? Eg. first by tvextraPriority and then by createdon.

    Thanks.

      • 18397
      • 3,250 Posts
      Not currently, but this is planned.
        • 26178
        • 32 Posts
        Thanks very much, I would have to figure it out somehow to make my client happy... Any rough suggestions how to hack the ditto code?
          • 18397
          • 3,250 Posts
          You just need to do 2 simple things.

          1. Use &sortBy=`tvextraPriority`
          2. Just before the for loop in the snippet add a call to the customSort function with tvextraPriority,createdon as the sort.
            • 30882
            • 3 Posts
            Hi -

            I’ve noticed that the latest versions of Ditto claim to have multiSort capabilities, but I haven’t been able to find any documentation on how this works? I tried just putting multiple values in the "sortBy" field, as well as replacing the "sortBy" call with "multiSort" - neither of which worked.

            I glanced through the latest Ditto release (stable and beta), looking for hints about how to properly invoke multisorting capabilities, but I didn’t see anything.

            Can you anyone else point me in the right direction for either documentation on how to do this, or how to config the Ditto call to do what I need (sort by multiple TV fields)? Or do we still have to do the custom mod of the snippet code to get the multisort capabilities?

            Thanks smiley
            twykr.
              • 18397
              • 3,250 Posts
              Ditto 2.1 Beta 2 supports the use of &orderBy which uses the same syntax as its mysql namesake. Thus, you can use something like &orderBy=`pagetitle ASC, id DESC`.
                • 30882
                • 3 Posts
                Quote from: Mark at Nov 12, 2007, 12:08 AM

                Ditto 2.1 Beta 2 supports the use of &orderBy which uses the same syntax as its mysql namesake. Thus, you can use something like &orderBy=`pagetitle ASC, id DESC`.

                Hi Mark -

                Perfect, that’s what I needed! My problem previously was that I’d left the "sortBy" and "sortDir" specifiers in the Ditto call, alongside the newer "orderBy" specifier - and when I saw the output error, I figured the command wasn’t implemented that way. Turns out I only need to make sure I’m using one form of sorting at a time smiley

                Thanks!
                twykr