We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14344
    • 16 Posts
    I am trying to get getResource to work on my modx revo site. But when I view the resource with the getResource snippet there is nothing where the getResource code is, even when I look at the view page source in firefox there is blank space there! I have tried this where it would just pull and list page titles but I still ended up with a blank page.
    I using:
    getResource 1.3.1
    MODX Revolution 2.1.3-pl (traditional)

    This is my snippet:
    [[!getResources? &parents=`5` &includeContent=`1` &includeTVs=`1` &processTVs=`1` &tpl=`Dark_Matter_Gallery`]]


    This is my chunk:
    <img src="[[+tv.Image_File]]" alt="[[+tv.Image_Description]]" />
      • 8609
      • 607 Posts
      Your tpl chunk needs to include every field you want to pull in. Right now your chunk is only set up to pull up the contents of an image TV. You say you want the title, so you should have something like

      <p>[[+pagetitle]]

      <img src="[[+tv.Image_File]]" alt="[[+tv.Image_Description]]" />

      Best way to start troubleshooting your call is to first do it without the tpl and see if you get an array outputted on the page. If you get an array then you just need to work on your tpl.

      HTH
        • 14344
        • 16 Posts
        Just tried [[!getResources? &parents=`5`]] and [[getResources]] neither one comes up with an error or anything else. Also uninstalled the package and reinstalled it and I am still get nothing. Also I don’t want the title but I tried adding the title to see if my TVs were the problem but as always with getResource I got nothing!

        Thanks for the help einsteinsboi.
          • 8609
          • 607 Posts
          Are the resources you’re aggregating hidden from the menu? If yes you need to add &showHidden=`1` to your getresources call.

          This post might help - http://codingpad.maryspad.com/2011/04/11/modx-revolution-for-complete-beginners-part-10-using-getresources-to-aggregate-content/
            • 3749
            • 24,544 Posts
            You could also try adding [[+pagetitle]] to your Tpl chunk. If the pagetitles show, then getResources is finding resources and finding your Tpl chunk.

            Check the spelling on the Tpl chunk name versus the name you’re using in the tag and the spelling of the field names in the Tpl chunks. Also, the way you’re doing it, the TVs need the "tv." prefix in their names (or you need to use &tvPrefix=``).
              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
              • 3749
              • 24,544 Posts
              You could also try adding [[+pagetitle]] to your Tpl chunk. If the pagetitles show, then getResources is finding resources and finding your Tpl chunk.

              Check the spelling on the Tpl chunk name versus the name you’re using in the tag and the spelling of the TV names in the Tpl chunks (they’re case-sensitive). Also, the way you’re doing it, the TVs need the "tv." prefix in their names (or you need to use &tvPrefix=``).
                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