We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40122
    • 330 Posts
    Hi all,

    Not sure about this one. I have the getResources code as such:

    [[!getResources? &parents=`57` &limit=`99` &tpl=`isotopeitemtmp` &includeTVs=`1` &processTVs=`1` &sortby=`RAND()` ]]


    but whilst the resources are displaying, theyre not in random order as the RTFM suggests.

    Anyone know if I have missed a step?

    Thanks
      • 42046
      • 436 Posts
      Try it in a JSON array specifying the sort field as well: &sortby=`{"publishedon":"RAND()"}`
        • 40122
        • 330 Posts
        Quote from: absent42 at Nov 07, 2013, 07:30 AM
        Try it in a JSON array specifying the sort field as well: &sortby=`{"publishedon":"RAND()"}`

        Thanks but no luck there
          • 42046
          • 436 Posts
          It should be working fine. I've just tested your exact call (but with a different template obviously)and it works on my system.

          A couple of bluesky ideas:

          If you limit the &limit down to say 5 or 10 does it randomly sort? I'm just thinking if there could be timeout somewhere in returning 99 records before they're sorted. You could try turning off processTVs too to reduce the load.

          Secondly, are you using MySQL 5.0.51? RAND() is a mySQL function, and there are some issues with ORDER BY queries (not 100% sure what exact effect this c.ould have on RAND() though)