We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40122
    • 330 Posts
    I am using getResources with the following:

     &parents=`91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,75`
     &sortby=`menuindex ASC, id`
     &sortdir=`ASC`


    Sorting by menu index works fine for resources within their own parent resources but is there anyway to display resources belonging to a particular parent last?

    Eg: In the list generated above, I want all child resources of 75 to be displayed last.

    Thanks in advance!
      • 5430
      • 247 Posts
      Simplest method would simply be to separate parent 75 into a separate getResources call.

      Do the parents listed above have a common identifier (tv value or ancestory) that would allow you to gather them via a getResources call? If so, you could place a new getResources call inside the template you use for the initial call and could then order the parents exactly as you wish using &sortby=`FIELD(modResource.id, 91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,75 )` in the initial call.
        • 28120
        • 380 Posts
        The following getResourcesTree worked well for me

        https://forums.modx.com/index.php/topic,43832.msg333619.html