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

    I'm trying to make an image gallery using MIGX.

    So, I have created the first TV ->

    1. name: imageTV
    2. input type : image
    3. template access - none

    And then the second TV ->

    1. name: images
    2. input type : migx
    3. form tabx:
    [
    {"caption":"Image", "fields":[
        {"field":"image","caption":"Image","inputTV":"imageTV"}
    ]}
    ]
    

    4. template access - imageTemplate

    Then the first chunk ->

    1. name: imageChunk
    2. HTML:
    <li>
    <img src="[[+image]]" alt="" class="image" />
    </li>
    


    Then the second chunk ->

    1. name: all_Images
    2. HTML:
    <ul>
      [[!getImageList? 
        &tvname=`images`
        &tpl=`imageChunk`
      ]]
    </ul>
    


    And finally the template (name : imageTemplate) with only this code
    [[$all_Images]]
    , which works fine.

    But if I create a new document using the same template and where I have one TV extra ( also an image, name: main_image ), the MIGX uses that image instead of all the images I added. I cleared the catch, but no luck. And if I remove template access from the TV (main_image), it is also working and showing the slideshow of only that one image.

    What am I doing wrong ?

    Thank you [ed. note: vucko2405 last edited this post 13 years, 5 months ago.]
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      I'm not sure that I understand.

      Your template (imageTemplate) only has the chunk [[$all_Images]], it doesn't have [[*content]] in it?

      The second image TV is in the content field of the second page? The template will only show the MIGx TV, in this case; it won't show your second image TV's image at all, since you didn't tell it to show the page's content.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 4172
        • 5,888 Posts
        you want to say:

        As soon as you create a image-TV with name: main_image
        and you put
        [[*main_image]]
        to your template

        you get
        [[+image]]

        replaced with your main_image - image

        in all MIGX-items with this getImageList-tpl:
        <img src="[[+image]]" alt="" class="image" />

        ?

        This sounds very strange to me.
          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Indeed. Working as expected for me; I set up the exact TVs and chunks described - except I do have the Grid Columns in the MIGx tv
          [
          {"header": "Image", "width": "50", "sortable": "false", "dataIndex": "image","renderer": "this.renderImage"}
          ]
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 42970
            • 27 Posts
            It's interesting because when I try to update the older document ( change the slider images with new images ) it won't work, but when I make a new document with same template , it works normally. I can see the new images and I can change them.

            Very strange behavior. Is it possible that somehow some settings are stored in the catch and that it can't be deleted ?
              • 4172
              • 5,888 Posts
              Is it possible you had a image-TV with the same name (imageTV) created for that resource?

              You can check it by assigning the imageTV to the Template user for that resource.
              If there is an image, remove that, than remove the imageTV from that Template again.

              A image-TV used by MIGX should never be assigned to any Template!

              Better is not to use

              [
              {"caption":"Image", "fields":[
                  {"field":"image","caption":"Image","inputTV":"imageTV"}
              ]}
              ]
              


              but

              [
              {"caption":"Image", "fields":[
                  {"field":"image","caption":"Image","inputTVtype":"image"}
              ]}
              ]
              
                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
                • 42970
                • 27 Posts
                @Bruno17,

                Yes, I use the same TV for the main image and for the MIGX's images ( slider ) . I created the new TV image and use it for the slider and as I said , now it works fine , but for the older document it doesn't work.

                I can delete the older document and create them again so it can work fine, but is there a simpler way ?
                  • 4172
                  • 5,888 Posts
                  Just remove (empty) the image used for that Resource and than give your main-image-TV another name or use the method above and use
                  "inputTVtype":"image"


                  Than it does no longer conflict with any resource-TVs
                    -------------------------------

                    you can buy me a beer, if you like MIGX

                    http://webcmsolutions.de/migx.html

                    Thanks!
                    • 42970
                    • 27 Posts
                    @Bruno17,

                    Now I can't upload images , the button for selecting the images is missing.
                      • 4172
                      • 5,888 Posts
                      which versions of MODX and MIGX are we talking about?
                        -------------------------------

                        you can buy me a beer, if you like MIGX

                        http://webcmsolutions.de/migx.html

                        Thanks!