We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 51216
    • 35 Posts
    I used this to create a Migx gallery on one of my resources:
    https://rtfm.modx.com/extras/revo/migx/migx.tutorials/migx.use-resource-specific-mediasource-and-multifile-uploader

    That works with my Migx call:

    [[getImageList? 
      &tvname=`resourcealbum` 
      &tpl=`galleryMigxTpl`
    ]]


    But I would like to limit Migx entries to say, 10 entries.
    That's where pdoPage comes in:
    [[!PdoPage?
    	&element=`pdoResources`
    	&showHidden=`1`
    	&tpl=`galleryPdoTpl`
    	&limit=`10`
    	&includeTVs=`resourcealbum`
        &parents=`[[*id]]`
        &ajaxMode=`default`
    ]]


    I want to load more migx entries via AJAX by clicking a "load more" button.
    Is this at all possible? Would be awesome if someone can assist here!

    Thanks!
      • 4172
      • 5,888 Posts
      The element has to be getImageList, if you want to paginate MIGX-items.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 51216
        • 35 Posts
        I have tried that:
        [[!PdoPage?
            &element=`getImageList`
            &tpl=`galleryMigxTpl`
            &limit=`10`
            &includeTVs=`resourcealbum`
            &ajaxMode=`default`
        ]]

        But nothing shows when I refresh page... Any other ideas?
          • 4172
          • 5,888 Posts
          you need all the getImageList-properties

          [[!PdoPage?
              &element=`getImageList`
              &tvname=`resourcealbum` 
              &tpl=`galleryMigxTpl`
              &limit=`10`
              &ajaxMode=`default`
          ]]
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 51074
            • 14 Posts
            Quote from: Bruno17 at Apr 14, 2016, 10:10 AM
            you need all the getImageList-properties

            [[!PdoPage?
                &element=`getImageList`
                &tvname=`resourcealbum` 
                &tpl=`galleryMigxTpl`
                &limit=`10`
                &ajaxMode=`default`
            ]]

            This decision doesn't help! Images without full path are loaded.
            instead of such path ".../assets/components/phpthumbof/cache/C8iI0NqIAQI.84c8aa8a55ba21155569ffd51f691b3d.jpg"
            clicking a "load more" button .../C8iI0NqIAQI.84c8aa8a55ba21155569ffd51f691b3d.jpg"

                    [[!PdoPage?
                    &element=`getImageList`
                    &tvname=`resourcealbum` 
                    &toPlaceholder=`migx_output`
                    &tpl=`news_images` 
                    &limit=`12`
                    &ajaxMode=`button`
                    &where=`{"published":"1"}`
                    ]]

            How to correct it?
              • 4172
              • 5,888 Posts
              does it load the correct path, without the pdoPage - stuff?

              Or do you have that issue only while loading by ajax (after clicking the "load more" - button)?
                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
                • 51074
                • 14 Posts
                Quote from: Bruno17 at Aug 26, 2016, 03:47 PM
                does it load the correct path, without the pdoPage - stuff?

                Or do you have that issue only while loading by ajax (after clicking the "load more" - button)?

                Only while loading by ajax (after clicking the "load more" - button)!!! The first limit(ex: &limit=`12`) loads with images, after clicking the "load more" there are no images. Without ajaxMode everything works well.

                Similar problem and here migxdb.
                   
                [[!pdoPage?
                &elementClass=`modSnippet`
                &element=`migxLoopCollection`
                &limit=`3`
                &packageName=`mybooks`
                &classname=`mybooks`
                &sortConfig=`[{ "sortby":"id","sortdir":"DESC" }]`               
                &tpl=`tplNovinki`
                &totalVar=`ImagTotal`
                &toPlaceholder=`ImagesResult`
                &ajaxMode=`button`
                ]]


                The first limit(&limit=`3`) with images:
                <img src="/assets/components/phpthumbof/cache/gde_to.ec6e4d1a9981a6032a93be153c3ff44c.jpg" alt="" class="img-responsive">

                after clicking the "load more" - root directory. Can because I use imagePlus?
                <img src="../domains/modx/" alt="" class="img-responsive">


                [ed. note: lwinds last edited this post 7 years, 8 months ago.]
                  • 53178
                  • 24 Posts
                  Hi,
                  I have the same issue with the image src breaking. Did you find a solution? Please help me with it?

                  Quote from: lwinds at Aug 29, 2016, 08:58 AM
                  Quote from: Bruno17 at Aug 26, 2016, 03:47 PM
                  does it load the correct path, without the pdoPage - stuff?

                  Or do you have that issue only while loading by ajax (after clicking the "load more" - button)?

                  Only while loading by ajax (after clicking the "load more" - button)!!! The first limit(ex: &limit=`12`) loads with images, after clicking the "load more" there are no images. Without ajaxMode everything works well.

                  Similar problem and here migxdb.
                     
                  [[!pdoPage?
                  &elementClass=`modSnippet`
                  &element=`migxLoopCollection`
                  &limit=`3`
                  &packageName=`mybooks`
                  &classname=`mybooks`
                  &sortConfig=`[{ "sortby":"id","sortdir":"DESC" }]`               
                  &tpl=`tplNovinki`
                  &totalVar=`ImagTotal`
                  &toPlaceholder=`ImagesResult`
                  &ajaxMode=`button`
                  ]]


                  The first limit(&limit=`3`) with images:
                  <img src="/assets/components/phpthumbof/cache/gde_to.ec6e4d1a9981a6032a93be153c3ff44c.jpg" alt="" class="img-responsive">

                  after clicking the "load more" - root directory. Can because I use imagePlus?
                  <img src="../domains/modx/" alt="" class="img-responsive">


                    • 53178
                    • 24 Posts
                    Found the solution, for the tv.image src to work with pdoPage, you have to add parameter &prepareTVs e.g &prepareTVs=`eventImg`