We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 47562
    • 113 Posts
    I'm having a bit of trouble getting an image out using MigX/getImageList.

    I'm wondering if this possibly has to do with the way the image is brought into MigX.

    I have a TV migxImageSolution with input type image, of appropriate media source; in the MigX form tabs, I use the entry:
      {"field":"cp_solution_image",
       "caption":"Image",
       "inputTV":"migxImageSolution"}


    Anyway, the html produced is as follows:
    For [[+cp_solution_image]], I get <img src alt="Product info" />
    For [[*cp_solution_image]], I get <img src="/siteroot/assets/images/solutions/[]" alt="Product info" />

    The getImageList call:

    [[getImageList? &tvname=`cp_solution` &tpl=`cp_solution_item_tpl`]]


    The tpl involved:

    <div class="solutions_info"><!-- Start Solutions Info -->
    	<img src="[[*cp_solution_image]]" alt="[[+cp_solution_name]]" />
    	<h4>[[+cp_solution_name]]</h4>
    	<p>[[+cp_solution_description]]</p>
    </div><!-- End Solutions Info -->
    


    How best to get the image to render properly?


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

      • 4172
      • 5,888 Posts
      with
       [[+cp_solution_image]]

      you should get the correct image.

      but it looks like you have or had created a TV cp_solution_image with this name and it is or was asigned to your template. This can result to
      conflicts like that.

      one way is, just to rename the image-field, for example to
      [[+cp_solution_img]]

      of course also in your formtabs - configuration.

      Or make sure there isn't any value in the db (modx_site_tmplvar_contentvalues) for the TV cp_solution_image and this TV is not asigned to your template.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 47562
        • 113 Posts
        Hey Bruno.

        Thanks very much for the explanation. Actually, I see a ton of entries in the db that have a value of []; not sure what I did to accomplish that.

        Would it be ok to delete these entries, or would it be best to leave them in place and just create new entries? (I don't like the idea of leaving garbage in the db, but at the same time, I don't want to end up on a slippery slope!)

        Thanks again for all your help.
          • 4172
          • 5,888 Posts
          this [] is/was (I think it is fixed with 2.8.0) a result of empty MIGX-TVs

          Removing them from db shouldn't break anything
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 47562
            • 113 Posts
            I removed all those entries from the db, and confirmed that the tpl contains

            	<div class="solutions_info"><!-- Start Solutions Info -->
            		<img src="[[+cp_solution_image]]" alt="[[+cp_solution_name]]" />
            		<h4>[[+cp_solution_name]]</h4>
            		<p>[[+cp_solution_description]]</p>
            	</div><!-- End Solutions Info -->


            Unfortunately, I'm seeing the following being put out for the image:

            <img src="" alt="Product info" />


            I'll try with a new tv name, to see if that helps...
              • 47562
              • 113 Posts
              Nope, even with a completely new tv, cp_solution_img, img is still showing up with an empty source...

              And I see that the [] values are still being placed in the table; the MigX I'm using is 2.6.8.
                • 4172
                • 5,888 Posts
                is it online, so I could have a look into your manager?
                  -------------------------------

                  you can buy me a beer, if you like MIGX

                  http://webcmsolutions.de/migx.html

                  Thanks!
                  • 47562
                  • 113 Posts
                  No, unfortunately, it's just on my local machine for right now; I have to get things moved over to a staging server soon, but I wanted to iron out a few kinks first...
                    • 4172
                    • 5,888 Posts
                    ok, then lets try the other way.

                    what do you get with:

                    [[*cp_solution]]
                      -------------------------------

                      you can buy me a beer, if you like MIGX

                      http://webcmsolutions.de/migx.html

                      Thanks!
                      • 47562
                      • 113 Posts
                      [{"MIGX_id":"1","cp_solution_name":"Solution name","cp_solution_page":"","cp_solution_description":"Summary of solution","cp_solution_img":"./enterprise_ott.png"}]