We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22446
    • 181 Posts
    I am having trouble with multiple getResources calls on on single page. Can you help me out?

    My first call is inside a chunk and the call looks like this.
    [[!getResources? &parents=`4` &limit=`all` &includeContent=`1` &sortby=`{"publishedon":"ASC","createdon":"DESC"}` &showHidden=`1` &includeTVs=`1` &tvPrefix=`` &tpl=`Webcam_Homepage_tpl` &processTVs=`1` &resources=`-189, -190`]]

    My second call is also inside a chunk and the call looks like this.
    [[!getResources? &parents=`0` &limit=`4` &includeContent=`1` &sortby=`{"publishedon":"DESC","createdon":"ASC"}` &showHidden=`0` &tpl=`recentpub`]]

    The second call doesn't output anything. I know the second call works because on a page that there is no getResources call, everything displays correctly.
      • 22303 MODX Staff
      • 10,725 Posts
      You'll have to provide the MODX tags within code tags here in the forums.
        • 22446
        • 181 Posts
        Oops, I forgot about that. Here are the callouts.

        First Call
        [[!getResources? &parents=`4` &limit=`0` &includeContent=`1` &sortby=`{"publishedon":"ASC","createdon":"DESC"}` &showHidden=`1` &includeTVs=`1` &tvPrefix=`` &tpl=`Webcam_Homepage_tpl` &processTVs=`1` &resources=`-189, -190`]]


        Second Call
        [[!getResources? &parents=`0` &resources=`` &limit=`4` &tpl=`recentpub` &includeContent=`1` &sortby=`{"publishedon":"DESC","createdon":"ASC"}` &showHidden=`0`]}


        The first call is building a gallery on the page. The second call is displaying recent published documents.
          • 22303 MODX Staff
          • 10,725 Posts
          Your second call ends with } instead of ] — is this a syntax error copied from your site, or was that a cut and paste mistake?
            • 22446
            • 181 Posts
            That was a cut and paste mistake.

            The second call is:
            [[!getResources? &parents=`0` &resources=`` &limit=`4` &tpl=`recentpub` &includeContent=`1` &sortby=`{"publishedon":"DESC","createdon":"ASC"}` &showHidden=`0`]]