We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6491
    • 70 Posts
    Hi All,
    I have created a simple MigX TV and have the back-end working.
    Form Tabs:
    [
    {"caption":"Add an image", "fields": [
         {"field":"image","caption":"Image", "inputTV":"slider_image"}
    ]}
    ] 

    Grid Columns:
    [
    {"header": "Image", "width": "100", "sortable": "true", 
    "dataIndex": "image","renderer": "this.renderImage"}
    ]


    Now I want to display the images inside my template like this, I don't need <div>s or <li>s, the script knows what do do with the images ...
    <img src="assets/images/background-slides-12.jpg" alt="" width="1400" height="1050" />
    <img src="assets/images/background-slides-11.jpg" alt="" width="1400" height="1050" />


    I tried this ...
      [[!getImageList? 
        &tvname=`slider_images`
        &tpl=`@CODE:<img src="[[+image]]" alt="" width="1400" height="1050" />
      `]]

    The images do not show up. What am I doing wrong?

    Thanks for your help.

    Dan
      • 30585
      • 833 Posts
      With the current version of MIGX, you don't need inputTV for basic images anymore. Just name your field, give it a caption and specify the field type as image with inputTVtype:
      [
      {"caption":"Image", "fields":[
          {"field":"image","caption":"Add an image","inputTVtype":"image"}
      ]}
      ] 


      If this doesn't do it. Try putting your @CODE tpl in a chunk instead.
        A MODx Fanatic
        • 4172
        • 5,888 Posts
        what do you get with

        [[*slider_images]]
          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!
          • 6491
          • 70 Posts
          Hi Bruno, I'm glad you could chime in. I hope you are well.

          When i put just ...
          [[*slider_images]]

          I get this in the generated code ...
          <img src="[{"MIGX_id":"2","image":"assets\/images\/AFT-DECK-facing-port-forward.jpg"},{"MIGX_id":"3","image":""},{"MIGX_id":"4","image":"ASM Corporate Page Property with NC-B.jpg"}]" alt="" />
          
            • 6491
            • 70 Posts
            Quote from: treigh at Nov 12, 2015, 09:36 PM
            With the current version of MIGX, you don't need inputTV for basic images anymore. Just name your field, give it a caption and specify the field type as image with inputTVtype:
            [
            {"caption":"Image", "fields":[
                {"field":"image","caption":"Add an image","inputTVtype":"image"}
            ]}
            ] 


            If this doesn't do it. Try putting your @CODE tpl in a chunk instead.

            Hi Treigh,

            Thanks for helping.

            Are you saying I must have a caption? I don't want a caption.

            Dan
              • 4172
              • 5,888 Posts
              [{"MIGX_id":"2","image":"assets\/images\/AFT-DECK-facing-port-forward.jpg"},
              {"MIGX_id":"3","image":""},
              {"MIGX_id":"4","image":"ASM Corporate Page Property with NC-B.jpg"}]
              


              the first one is looking good and should work.
              The second is empty and the last one doesn't have a path and has a strange filename.

              And try it with "inputTVtype":"image"
              instaed of "inputTV":"image"

              maybe you did have assigned the image-TV to a template.
              This can have unwanted results.
              Helper-TVs for MIGX should never be assigned to any template.
                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
                • 6491
                • 70 Posts
                Hi Bruno,

                Can you tell me exactly what I need to put in the page template? I am really just copying things, I don't really understand what I am doing. Sorry.

                Dan
                  • 6491
                  • 70 Posts
                  Quote from: Bruno17 at Nov 13, 2015, 07:32 AM
                  [{"MIGX_id":"2","image":"assets\/images\/AFT-DECK-facing-port-forward.jpg"},
                  {"MIGX_id":"3","image":""},
                  {"MIGX_id":"4","image":"ASM Corporate Page Property with NC-B.jpg"}]
                  


                  the first one is looking good and should work.
                  The second is empty and the last one doesn't have a path and has a strange filename.

                  And try it with "inputTVtype":"image"
                  instaed of "inputTV":"image"

                  maybe you did have assigned the image-TV to a template.
                  This can have unwanted results.
                  Helper-TVs for MIGX should never be assigned to any template.

                  I Don't understand. How do I get the output from this ...
                  [{"MIGX_id":"2","image":"assets\/images\/AFT-DECK-facing-port-forward.jpg"},
                  {"MIGX_id":"3","image":""},
                  {"MIGX_id":"4","image":"ASM Corporate Page Property with NC-B.jpg"}]

                  ... to this ...
                  <img src="assets/images/AFT-DECK-facing-port-forward.jpg" />
                  <img src="ASM Corporate Page Property with NC-B.jpg" />


                  Dan [ed. note: DanLoffler last edited this post 10 years, 10 months ago.]
                    • 4172
                    • 5,888 Posts
                    this should work, but only, if your image-pathes are correct:

                    [[!getImageList? 
                      &tvname=`slider_images`
                      &tpl=`@CODE:<img src="[[+image]]" alt="" width="1400" height="1050" />`
                    ]]


                    what do you get with this?
                      -------------------------------

                      you can buy me a beer, if you like MIGX

                      http://webcmsolutions.de/migx.html

                      Thanks!
                      • 6491
                      • 70 Posts
                      Quote from: Bruno17 at Nov 23, 2015, 12:42 AM
                      this should work, but only, if your image-pathes are correct:

                      [[!getImageList? 
                        &tvname=`slider_images`
                        &tpl=`@CODE:<img src="[[+image]]" alt="" height="1050" width="1400">`
                      ]]


                      what do you get with this?

                      I'm not getting anything, the source code is blank there.

                      I removed the second and third image (MigXID 3 and 4). I checked the path and it it correct (copied the file name from the TV, and pasted it in the browser).

                      See the attached screenshot ... [ed. note: DanLoffler last edited this post 10 years, 10 months ago.]