We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22827
    • 129 Posts
    I have a branch of my tree like this:

    Doc1
    Doc2
    Folder1
    -----Doc3
    -----Doc4
    Folder2
    -----Doc5
    -----Doc6
    -----Doc7

    I point getResources at the top of the tree, and I use an output filter to display a heading if it is a folder and some content if it isn't a folder.

    I am stuck trying to get the order right, I would like it to come out like

    • Documents in Root
    • First Folder
    • Documents in First Folder
    • Second Folder
    • Documents in Second Folder
    • etc....

    I am not all that concerned about what order the folders and documents appear within this structure (though it would be good to be able to influence it).

    Can any one think of a way I can get the documents to come out this way without explicitly setting a menuindex or similar that forces it (which would be difficult for a content editor to maintain).

    Otherwise I'll have to do a getresources call for each folder.

    Thanks...

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

    • discuss.answer
      GetResources really isn't built for nested structures like that. Depending on what kind of data you are displaying, you might be better off using Wayfinder and some heavily customized tpls for the various parts.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 22827
        • 129 Posts
        Oh ok - wayfinder.

        That hadn't occured to me - the templates I am using for getResources are really quite simple, so this may well be a good solution.
          • 22827
          • 129 Posts

          Wayfinder did the trick, thanks. If the output had been any more complex (such as involving tvs) then a series of getResources would be the way to go.