We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42088
    • 7 Posts
    Quote from: bobwal at Nov 30, 2012, 11:22 AM
    Sorry for the dredge, does anyone know if getResources supports order by tree yet?

    I'm curious about this too. In the meantime, thanks dj13. Very helpful snippet.
      • 40737
      • 32 Posts
      Hi,

      &sortby=`menuindex`
      &sortdir=`ASC`


      did the trick for me.

      Best,

      Mike
        • 40045
        • 534 Posts
        It should work with &sortby=`menuindex`, maybe you also want to provide &sortdir=`ASC` (but in my opinion it shouldn't be needed, would just default to DESC if not set...) and you could also try:

        &sortby=`{"menuindex":"ASC"}
          • 39446 ☆ A M B ☆
          • 51 Posts
          Quote from: bobwal at Nov 30, 2012, 11:22 AM
          Sorry for the dredge, does anyone know if getResources supports order by tree yet?
          I'll give dj13's snippet a go otherwise.

          Cheers

          Yes it does, you have to specify both, sortby=`menuindex` and sortdir=`ASC`

          Ex.

          [[!getResources?
          &parents=`15`
          &depth=`1`
          &limit=`9` 
          &tpl=`projectListItem` 
          &includeTVs=`1` 
          &processTVs=`1`
          &showHidden=`1`
          &sortby=`menuindex` 
          &sortdir=`ASC`
          ]]
          
            Mahalo,
            Jesse Showalter

            My Portfolio: http://www.jesseshowalter.com
            MODX Video Tutorials: http://jesseshowalter.com/search-results.html?search=MODX&id=22