We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40088
    • 708 Posts
    Revo 2.3.2

    I have a lot of nested folders, all several levels deep. Each folder contains a mix of other folders and documents (pages). For example:

    Home
    Level Folder
    + Level Folder
    ++ Level Folder
    +++ Doc
    +++ Level Folder
    ++++ Doc
    + Level Folder

    Using getResources I need to display all ‘Level’ folders site-wide, not any child pages. I've been able to filter folders but only 1 level deep, anything more shows pages too.

    [[!getResources?
    	&parents=`2`
    	&tpl=`myTpl`
    	&depth=`1`
    	&sortby=`alias`
    	&sortdir=`ASC`
    ]]

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

      Todd
    • discuss.answer
      • 3749
      • 24,544 Posts
      Try adding this to the tag:

      &where=`{"isfolder:=":"1"}`


      Make sure that the "container" checkbox is checked for the folders.

      This may not work for folders with no children. It used to, but I think the behavior of isfolder has changed. In that case you'd have to use a custom snippet instead of getResources.

        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
        • 40088
        • 708 Posts
        Thanks Bob, that works great. I forgot to set &limit=`0` which also solved part of the problem.
          Todd
          • 3749
          • 24,544 Posts
          I'm glad that worked for you. I kind of thought it wouldn't. Thanks for reporting back. smiley
            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