We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18608
    • 112 Posts
    I have an issue with the sorting options getResources that I hope someone has an idea on how to solve.

    The resources in the tree has the following structure:

    1. Parent
    - 1.a Child
    - 1.b Child
    - 1.c Child
    2. Parent
    - 2.a Child
    - 2.b Child
    - 2.c Child

    What I would like to do is call the resources with getResources and have them sorted like this:

    1, 1.a, 1.b, 1.c, 2, 2.a, ...

    The problem is, that if I choose to sort by menuindex, then the result will be : 1, 1.a, 2.a because they all have menuindex 1. If I set the menuindex manually then it will be changed the first time the resource is saved or a resource is reordered.
    I also tested sorting by parent, but that results in this: 1, 2, 1.a,1.b,1.c,2.a,....

    Does anyone have an idea to how to solve this? Any help will be much appreciated.

    This question has been answered by Bruno17. See the first response.

      Mathias Dannevang | Webdesigner at dannevang.org | Tweets @dannevang
    • discuss.answer
      • 4172
      • 5,888 Posts
      can't you nest two getResources - call into each other?
      Create a getResources - call for the parents and inside its tpl-chunk, call getResources for its children.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 18608
        • 112 Posts
        Quote from: Bruno17 at Dec 02, 2013, 06:58 AM
        can't you nest two getResources - call into each other?
        Create a getResources - call for the parents and inside its tpl-chunk, call getResources for its children.

        It works! Thank you, Bruno. That was great!
          Mathias Dannevang | Webdesigner at dannevang.org | Tweets @dannevang