We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42046
    • 436 Posts
    Apologies if this has been covered elsewhere but I can't track down a workable answer.

    I've trying to grab content from a Migx TV of a child resource and display the value but 'am unable to get this working.

    Calling the TV as standard displays the correct JSON output but I'm unable to find a method to parse that correctly.

    getImageList produces no results when trying to call a for a child and the snippet code from https://forums.modx.com/thread/76012/how-to-get-the-migx-output-array-into-a-snippet-with-runsnippet#dis-post-421167 gives me a php error.

    Any pointers would be most welcome.

    This question has been answered by Bruno17. See the first response.

    • discuss.answer
      • 4172
      • 5,888 Posts
      how do you get the id of the child-resource?

      you can use

      [[getImageList? &docid=`theChildID` &tvname=`yourMIGXTVname` &tpl=`yourTpl`]]
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 42046
        • 436 Posts
        Ah! So simple, how did I miss that? I'd omitted the &docid.

        Many thanks for the prompt answer.
          • 36549
          • 572 Posts
          NB: Got it working...just needed to change the [[+id]] to [[*id]] because the call is in a Template. That one always gets me:-/


          Hi,

          I'm having a similar issue but i want to grab the MIGx tv from all child resources. I'm using Articles and have an imageTv in each of the articles. I can get this to work when i actually hardcode the ID but not when i add [[+id]], so i know that MIGx is working.

          So this works, where `22` is the id of one of my child articles:
          [[!getImageList? &tvname=`myTv` &docid=`22` &tpl=`myTpl`]]


          But this does not work:
          [[!getImageList? &tvname=`myTv` &docid=`[[+id]]` &tpl=`myTpl`]]


          The article container has an id of `21` and i want all the child docs of this container to be displayed. Do i need to use getResources?

          Thanks for any help
          [ed. note: 9thwave last edited this post 13 years, 6 months ago.]
            www.9thwave.co.uk
               WEB | DESIGN | PRINT
            • 4172
            • 5,888 Posts
            you can try it cached:

            [[getImageList? &tvname=`myTv` &docid=`[[+id]]` &tpl=`myTpl`]]
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 36549
              • 572 Posts
              I sorted it Bruno. it was my incorrect syntax as i'm using the call in a template so it should be [[*id]] instead of [[+id]]. I've updated my post above.
              Thanks for your reply though all the same.
                www.9thwave.co.uk
                   WEB | DESIGN | PRINT
                • 4172
                • 5,888 Posts
                if you are calling the MIGX-TV of the current resource you don't need the property &docid.
                getImageList uses the id of the current resource by default.
                  -------------------------------

                  you can buy me a beer, if you like MIGX

                  http://webcmsolutions.de/migx.html

                  Thanks!