We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 39131
    • 84 Posts
    I’m using Articles.
    Each post has a picture with an alt-tag. I would like to use this picture both in the news-item itself and in the Articles-container.

    In the news-item [[$blog_layout]] is working fine.

    [[$blog_layout]]:

    [[!getImageList? 
    &tvname=`blog_tv` 
    &tpl=`blog_tpl` 
    ]]


    blog_tpl:

    <img src="[[+image]]" />


    Using [[+tv.blog_tv]] in the container returns:

    [{"MIGX_id":"1","image":"blog1.jpg","alt_text":"Alt text"}]

    In combination with getImageList

    [[!getImageList?
            &tvname=`blog_tv`
            &tpl=`blog_tpl`]]
    


    nothing happens.

    Any ideas what is going wrong?

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

    • discuss.answer
      • 4172
      • 5,888 Posts
      try to use it this way:

      [[!getImageList?
          &tvname=`blog_tv`
          &tpl=`blog_tpl`
          &docid=`[[+id]]`
      ]]
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 39131
        • 84 Posts
        Quote from: Bruno17 at Jan 15, 2013, 06:06 PM
        try to use it this way:

        [[!getImageList?
            &tvname=`blog_tv`
            &tpl=`blog_tpl`
            &docid=`[[+id]]`
        ]]

        Thanks Bruno for your answer. Another happy MODX user!

        The only thing I don't understand is that when I put
        [[!getImageList?
                 &tvname=`blog_tv`
                &tpl=`blog_tpl`
                &docid=`[[+id]]`
                ]] 


        in the container, everything is working fine.

        When I put the same code in a chunk and call the chunk with [[$name_of_the_chunk]] nothing happens...
          • 4172
          • 5,888 Posts
          does it work, when you call it cached?

          [[getImageList?
                   &tvname=`blog_tv`
                  &tpl=`blog_tpl`
                  &docid=`[[+id]]`
                  ]]


          may be you will need to add the property to your chunk:

          [[$name_of_the_chunk? &id=`[[+id]]`]]
          




            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 39131
            • 84 Posts
            Bruno, thanks again.

            [[$name_of_the_chunk? &id=`[[+id]]`]]
            was the solution to the problem.

            Don't ask me why.. smiley