We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36565
    • 73 Posts
    Hi,

    I would be most grateful if someone with a little MIGX expertise is willing to help me out with this one, as I'm already intermittently banging my head against nearby walls.

    In a resource I have a call to a chunk (PF1-ItemID is pointing to a resource that I have a MIGX TV assigned to):
    [[$PF1-gRF? &PF1-ItemID=`52`]]


    This is a MIGX call that is inside that chunk:
    <div>
    [[getImageList? 
        &docid=`52`
        &tvname=`PF1-Galerie`
        &tpl=`PF1-Galerie`
        &outputSeparator=`
    `
      ]]
    </div>

    Oh yeah, calling getImageList uncached here doesn't change a thing.

    The TV PF1-Galerie is a migx-type TV. The following is the form tabs definition and the grid column definition:
    [{
      "caption":"Galeriebilder",
      "fields": [{
        "field":"bild",
        "caption":"Bild",
        "inputTV":"PF1-Bild"
      }]
    }]


    [
    {"header": "Bild", "width": "60", "sortable": "false", "dataIndex": "bild", "renderer":"this.renderImage"}
    ]

    PF1-Bild, the inputTV, is a simple image-type TV not assigned to any template.
    The following is the contents of the chunk PF1-Galerie:
    <a href="[[+bild]]" 
    [[+_first:empty=`style="display:none"`]] class="zoom project_image">
    <img src="[[+bild]]" alt="" class="" rel="colorbox" width="220px" height="150px">
    </a>


    When I have five different images assigned to resource with id 52 (via the MIGX tv, to be sure), in the resulting page I get the following sourcecode:
    <div>
    <a href="assets/images/visualisierung/Innen1.jpg" 1 class="zoom project_image"><img src="assets/images/visualisierung/Innen1.jpg" alt="" class="" rel="colorbox" width="220px" height="150px"></a>
    <a href="assets/images/visualisierung/Innen1.jpg" style="display:none" class="zoom project_image"><img src="assets/images/visualisierung/Innen1.jpg" alt="" class="" rel="colorbox" width="220px" height="150px"></a>
    <a href="assets/images/visualisierung/Innen1.jpg" style="display:none" class="zoom project_image"><img src="assets/images/visualisierung/Innen1.jpg" alt="" class="" rel="colorbox" width="220px" height="150px"></a>
    <a href="assets/images/visualisierung/Innen1.jpg" style="display:none" class="zoom project_image"><img src="assets/images/visualisierung/Innen1.jpg" alt="" class="" rel="colorbox" width="220px" height="150px"></a>
    <a href="assets/images/visualisierung/Innen1.jpg" style="display:none" class="zoom project_image"><img src="assets/images/visualisierung/Innen1.jpg" alt="" class="" rel="colorbox" width="220px" height="150px"></a>
    </div>


    Why does MIGX put the same image into +bild in every row? I am not expecting this to be a bug in MIGX or so, but I just cannot find yet the error in my code.

    Thanks a lot in advance! [ed. note: neo2.0 last edited this post 15 years, 1 month ago.]
      PHP illiterate MODx enthusiast
      • 4172
      • 5,888 Posts
      what do you get with:

      [[getImageList?
          &docid=`52`
          &tvname=`PF1-Galerie`
        ]]
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 36565
        • 73 Posts
        Thanks for your assistance!

        I get the following:
        Array
        (
            [bild] => assets/images/visualisierung/Innen1.jpg
            [_alt] => 0
            [_first] => 1
            [_last] => 
            [idx] => 1
        )
        
        Array
        (
            [bild] => assets/images/visualisierung/Innen1.jpg
            [_alt] => 1
            [_first] => 
            [_last] => 
            [idx] => 2
        )
        
        Array
        (
            [bild] => assets/images/visualisierung/Innen1.jpg
            [_alt] => 0
            [_first] => 
            [_last] => 
            [idx] => 3
        )
        
        Array
        (
            [bild] => assets/images/visualisierung/Innen1.jpg
            [_alt] => 1
            [_first] => 
            [_last] => 
            [idx] => 4
        )
        
        Array
        (
            [bild] => assets/images/visualisierung/Innen1.jpg
            [_alt] => 0
            [_first] => 
            [_last] => 1
            [idx] => 5
        )
        
          PHP illiterate MODx enthusiast
          • 4172
          • 5,888 Posts
          strange.
          And what is the value (json-string) of this TV?
          What do you get, when you put this placeholder
          [[*PF1-Galerie]]
          into your resource 52 and call this resource?
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 36565
            • 73 Posts
            When I do this, I get the following interesting output:
            [{"bild":"visualisierung/Innen1.jpg"},{"bild":"visualisierung/Innen2.jpg"},{"bild":"visualisierung/Innen3.jpg"},{"bild":"visualisierung/Innen4.jpg"},{"bild":"visualisierung/Innen5.jpg"}]

            What does that mean?
              PHP illiterate MODx enthusiast
              • 4172
              • 5,888 Posts
              the value (json-string of your records) looks ok. Seems there goes something wrong on TV- or chunk-processing in getImageList here.

              Perhaps I can have a quick look to it, if this project is online?
                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
                • 36565
                • 73 Posts
                If you don't mind, I will send you a private message with the login data shortly.
                  PHP illiterate MODx enthusiast
                  • 4172
                  • 5,888 Posts
                  The issue was:

                  There was a filled PF1-Bild-TV for the resource 52 (removed from its Template, but still filled with an image)
                  The function renderOutput in getImageList got allways the value of this TV, of course.

                  You should never use a TV in a Template, which you are using for MIGX!
                    -------------------------------

                    you can buy me a beer, if you like MIGX

                    http://webcmsolutions.de/migx.html

                    Thanks!
                    • 36565
                    • 73 Posts
                    Triple Wow! I have to say I am absolutely impressed by the kind of support I am given here.
                    Having the snippet developer looking into my live code? That's absolutely brilliant, to say the least.
                    I don't think I can ever thank you enough.

                    I don't think I would ever have discovered this kind of error source, either. I had another instance of a similar call, only in another resource, that kept showing me 5 times the same image. After a moment, I figured I might just duplicate the image-type TV without the contents, and use that as the inputTV for PF1-Galerie, and voilà, everything's fine there, too.

                    So today, I have learned a freaking lot about this awesome CMF, and I think it will only get better. smiley

                    Thank you and Kudos to Bruno17, you truly made my day. By the way, MIGX is a hell of an extra for MODx. I think it should be part of the core.

                    By another way, can one use MIGX TVs as input TVs for a MIGX TV somehow? That would be over the top.
                      PHP illiterate MODx enthusiast
                      • 11838 ☆ A M B ☆
                      • 79 Posts
                      I have an issue with migx, here is migx tv code:

                      [
                      {"caption":"Actualités", "fields": [
                      {"field":"image","caption":"image","inputTV":"image"},
                      {"field":"titre_actu1","caption":"Titre de l'actualité 1"},
                      {"field":"actu_date1","caption":"actu_date1","inputTV":"actu_date1"},
                      {"field":"actu_texte1","caption":"actu_texte1"},
                      {"field":"link1","caption":"link1","inputTV":"link1"}
                      ]}
                      ]


                      and

                      [
                      {"header": "Title", "width": "160", "sortable": "true", "dataIndex": "titre_actu1"},
                      {"header": "image", "width": "50", "sortable": "false", "dataIndex": "image","renderer": "this.renderImage"},
                      {"header": "actu_date1", "width": "160", "sortable": "true", "dataIndex": "actu_date1"},
                      {"header": "actu_texte1", "width": "160", "sortable": "true", "dataIndex": "actu_texte1"},
                      {"header": "lien1", "width": "160", "sortable": "true", "dataIndex": "lien1"}
                      ]


                      and in my template:

                      [[!getImageList? 
                          &tvname=`Actualites`
                          &tpl=`@CODE:<img src="images/[[+image]]"/>
                        `]]


                      but it display that in source code:

                      <img src="images/"/>
                      <img src="images/"/>
                      <img src="images/"/>


                      if i call the migx tv [[*Actualites]] everything seems fine :

                      [{"MIGX_id":"3","image":"502007d69e3cdDistrict_Tile_Homepage_985x430.jpg","titre_actu1":"actu1","actu_date1":"2013-03-20 02:15:00","actu_texte1":"fefefef e gregergreg","link1":"11"},{"MIGX_id":"4","image":"50340abe202a2Grove_Brickworks_New_Sizes_985x430.jpg","titre_actu1":"actu2","actu_date1":"2013-03-27 00:30:00","actu_texte1":"df grgerzg zerg zeg ","link1":"22"},{"MIGX_id":"5","image":"2.jpg","titre_actu1":"actu3","actu_date1":"2013-03-11 02:15:00","actu_texte1":"gr grth trh rthj trj tr","link1":"22"}] /


                      Anyone can help ? thanks !