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 have getresources call:

    [[!getResources? &parents=`[[*id]]` &limit=`15` &tpl=`contentsectiontpl` &sortdir=`ASC` &sortby=`menuindex` &includeContent=`1`]]


    In a parent resource. I wish to only display the child resources of this parent, but the above displays both the child resources, and the resources on the same level as the parent.

    Does anyone know the correct way to achieve displaying only the child resources without using the parents ID directly?

    Thanks!
      • 36763
      • 70 Posts
      This may work?


      [[!getResources? &parents=`[[*id]]` &resources=`-10, -6,-7` &limit=`15` &tpl=`contentsectiontpl` &sortdir=`ASC` &sortby=`menuindex` &includeContent=`1`]]

      Where the &resources with minus values are the ones it excludes? I haven't tried it myself, I'm just reading the examples from doco. (http://rtfm.modx.com/extras/revo/getresources).

      Are your parents fields dynamic? Or static?
        • 36561
        • 38 Posts
        &parents=`[[*id]]` should definitely not display resources at the same level as the current resource.

        Are you sure, you're on the correct resource?

          • 3749
          • 24,544 Posts
          I'm with sashame. I can't imagine any way this could happen unless:

          1. You're confused about the structure of the Resoure tree
          2. You have a template variable called 'id'
          3. You have a plugin that's messing with the page IDs. I think there's a sibling plugin that could be doing it.

          Assuming that it's not one of those:

          First, try deleting all files in the core/cache directory and clearing your browser cache and cookies.

          If that doesn't work, I'd try disabling all plugins by right-clicking on them and selecting "disable plugin". Then delete the cache files again.

          If you're still seeing it, uninstall, remove, re-download, and re-install getResources, then delete the files in the core/cache directory before testing.

            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
            • 44565
            • 15 Posts
            Quote from: meltingdog at Oct 31, 2013, 05:57 AM
            I have getresources call:

            [[!getResources? &parents=`[[*id]]` &limit=`15` &tpl=`contentsectiontpl` &sortdir=`ASC` &sortby=`menuindex` &includeContent=`1`]]

            Is this snippet inside of a nested chunk? Then you must use [[+id]] instead of [[*id]] to ensure right context.