We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36551
    • 416 Posts
    I'm having trouble getting GetResources or PDOresources to display anything on a test site with two contexts. This is a new installation of Modx 2.4.0 on a Hostmonster server

    I followed this tutorial, http://cmstricks.com/blog/2013/05/10/contextrouter-review?ref=MODXForum, to setup the contexts.

    There are two domains pointing to the root of the site. I believe the contexts are working correctly. Each domain resolves to their respective start pages.

    Wayfinder will generate a menu including resources from the other context, manual links I put on the page will go to the other context and GetResourceField will pull content from the other context.

    GetResources won't display anything from either context. If I turn on Debug, it will display all the values of the pages from both contexts in the array.
    [[!getResources? &parents=`1`  &tpl="test-tpl" &debug=`0`]]


    The test-tpl contains this.
    <p>Page-[[+id]]: [[+pagetitle]]</p>


    I've also tried PDO resources. It just displays the debug array.
    [[!pdoResources? &parents=`0` &context=`svaroopa` &tpl="test-tpl"  ]]


    From everything I've read in the forums these should just work.

    Any suggestions? [ed. note: terrybarth last edited this post 11 years, 1 month ago.]
      • 36551
      • 416 Posts
      Anybody?
        • 33337
        • 3,975 Posts
        Am I right to notice that you have double quotes instead of back ticks around the &tpl?
          Zaigham R - MODX Professional | Skype | Email | Twitter

          Digging the interwebs for #MODX gems and bringing it to you. modx.link
          • 36551
          • 416 Posts
          Ugh! (slap forehead)

          I can't believe I made such a rookie mistake! I've looked at this a dozen times and didn't see it. Thanks for the extra set of eyes.
            • 33337
            • 3,975 Posts
            Glad to be of some help! smiley
              Zaigham R - MODX Professional | Skype | Email | Twitter

              Digging the interwebs for #MODX gems and bringing it to you. modx.link