We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34193
    • 330 Posts
    Hi is it me missing something or is it a bug I have used the following snippet call with getResources

    [[getResources? &parents=`6` &depth=`99` &includeContent=`1` &tpl=`rss_feed` ]]

    And it works fine. I am now wanting to do something similar but instead of listing just docs in a given container ie 6 as above I want to work on all docs within the site so as such I have tried

    [[getResources? &parents=`0` &depth=`99` &includeContent=`1` &tpl=`rss_feed` ]]
    and
    [[getResources? &parents=`1` &depth=`99` &includeContent=`1` &tpl=`rss_feed` ]]

    But neither display any output.
      • 34193
      • 330 Posts
      OK from what I can see from investigstions when parents is set to 0 then the test

      $parents = !empty($parents) ? explode(',', $parents) : array($modx->resource->get('id'));


      is setting the parents variable to the current calling resource id.

      I test this by adding the following just after this line

      return implode("\n", $parents);


      and then trying the call

      [[getResources? &parents=`0` &depth=`99` &includeContent=`1` &tpl=`rss_feed` ]]

      on a couple of different pages and it always returns the calling resources id.

      when I specify a parent other than 0 then it returns the ID specified in the call

      so I tried changing the !empty to isset and all works fine.