We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36066
    • 3 Posts
    I recently ran into a case where GetResources would only render the resources returned by the previous call in the page. The resource I wanted to render did not have a parent, it's a document that the site admin can add to or leave out of a context. This code worked in a previous version of ModX 2.x:

    [[!GetResources:default=`Check homepage for site hours!`? &resources=`[[findBy? &param=`pagetitle` &value=`Hours` &return=`id`]]` &limit=`1` &showunpublished=`1` &tpl=`Blank` &includeContent=`1`]]
    


    To fix things I moved my Hours document to being a child of a doc called "Hours Parent". This works as intended:

    [[!GetResources:default=`Check homepage for site hours!`? &parents=`[[findBy? &param=`pagetitle` &value=`Hours Parent` &return=`id`]]` &tpl=`Blank` &includeContent=`1` &includeTVs=`1` &processTVs=`1` &limit=`1`]]
    


    I'm not sure what's going on, I suspect it's related to this bug: http://bugs.modx.com/issues/5152
      • 8109
      • 128 Posts
      Hey, I have been battling this same bug in revo 2.0.2... I was putting every Get resources call twice (once in html comment tags), in order to get what I needed. But sure slows things down if there's lots of resources being called...
        Revo 2.0.8-pl
        • 22303 MODX Staff
        • 10,725 Posts
        The OP's issue was that he needed to specify &parents=`-1` when using &resources.