We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18367
    • 834 Posts
    I'm trying to use the &sortby=`RAND()` option in getResources.

    First time I tried it, it worked, but everytime since then i can't seem to get it to work.

    Code as follows:
    [[!getResources? &tpl=`homelatest` &parents=`78` &depth=`1` &limit=`1`  &offset=`0` &sortby=`RAND()`  &includeContent=`1` &includeTVs=`1` and &processTVs=`1` ]]

    Any ideas of where I'm going wrong?

    Thanks [ed. note: markg last edited this post 11 years, 6 months ago.]
      Content Creator and Copywriter
      • 42562
      • 1,145 Posts
      Quote from: markg at Apr 03, 2015, 02:06 AM
      [[!getResources?  &includeContent=`1` &includeTVs=`1` and &processTVs=`1`]]
      

      What is your present result?
      And what is the "and"doing there? I have never seen it before.
        TinymceWrapper: Complete back/frontend content solution.
        Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
        5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
        • 18367
        • 834 Posts
        Don,

        The present result just gives the normal result IE not randomized.

        I don't know why the and is there. Probably because somebody previously told me to do it that way.
          Content Creator and Copywriter
          • 3749
          • 24,544 Posts
          The 'and' definitely shouldn't be there.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 18367
            • 834 Posts
            It's now working - strangely with or without the and.

            Who knows, still a win's a win.

              Content Creator and Copywriter
              • 42562
              • 1,145 Posts
              ..."And" so they worked happily ever after...the end!
                TinymceWrapper: Complete back/frontend content solution.
                Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
                5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.