We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14020
    • 75 Posts
    Quote from: dinglestein at Jan 13, 2017, 03:29 AM
    Sorry I forgot to post back here reporting what was wrong for me haha.

    So my call was missing the page TPL and I suppose not generating my image TPL without it being called.

    [[!getImages?
    &getImages_Folder=`assets/images/facility`
    &getImages_Image_Tpl=`facilityGalleryTPL`
    &getImages_Page_Tpl=`example_getImages_Page_Tpl`
    ]]

    Thanks,

    JD
    Thanks for letting me know. BTW you need not add the
    &getImages_Page_Tpl=`example_getImages_Page_Tpl`
    line. You just need to copy the example_getImages_Page_Tpl chunk and name it
    getImages_Page_Tpl as that is the default.
      • 53484
      • 9 Posts
      I'm creating a gallery with paging (which works fine), the user can click the images and they open in a lightbox (swipebox) but as a page only shows the images thats being parsed through the snippet the lightbox also stops with the latest image on the page. So I made another call for all the image links so the loading of the rest of the images (on following pages, with an offset like https://forums.modx.com/thread/72386/getpage-cannot-get-offset-and-total-to-work#dis-post-432900) also can be viewed, but after a page or 2 the remaining images aren't being loaded anymore.

      It seems like it only loads the total amount (lets say 120), and then some remaining 30 and on page 3 there aren't any 'hidden' images anymore. It seems it got to do with the paging which counts down by every page, how to make sure that one every page all the remaining images (minus the offset) will be loaded? Can getPage being called two times as it seems they conflict with eachother (?). The paging snippet is only added in the first call ('getImages_Page').

      [[!getPage?
      						&elementClass=`modSnippet`
      						&element=`getImages`
      						&getImages_Folder=`assets/themes/[[++site_template]]/galleries/[[*Blox.Main.Full.Gallery.Default.ID]]` 
      						&getImages_Ext =`jpeg,jpg,gif,png,JPEG,JPG,GIF,PNG`
      						&getImages_Image_Tpl =`getImages_Image`
      						&getImages_Page_Tpl =`getImages_Page`
      						&getImages_Class =`imgThumbItem`
      						&getImages_PageClass =`imgThumbList`
      						&getImages_Id =`imgId`
      						&getImages_PageId =`div`
      						&getImages_Paging =`1`
      						&getImages_Sort=`[[*Blox.Main.Full.Gallery.Default.Sorting]]`
      						&limit=`[[*Blox.Main.Full.Gallery.Default.ThumbsPerPage]]`
      						&pageLimit=`10`
      					]]
      
      					[[!getPage?
      						&elementClass=`modSnippet`
      						&element=`getImages`
      						&getImages_Folder=`assets/themes/[[++site_template]]/galleries/[[*Blox.Main.Full.Gallery.Default.ID]]` 
      						&getImages_Ext =`jpeg,jpg,gif,png,JPEG,JPG,GIF,PNG`
      						&getImages_Image_Tpl =`getImages_Image_Hidden`
      						&getImages_Page_Tpl =`getImages_Page_Hidden`
      						&getImages_PageClass =`imgThumbListHidden`
      						&getImages_PageId =`div`
      						&getImages_Paging =`1`
      						&getImages_Sort=`[[*Blox.Main.Full.Gallery.Default.Sorting]]`
      						&initialOffset=`[[*Blox.Main.Full.Gallery.Default.ThumbsPerPage]]`
      						&limit=`120`
      					]]
      


      Thanks in advance!
        • 14020
        • 75 Posts
        I'm not sure that I fully understand what you are doing but I'll take a stab at it. In the second call you want all the images, right? If so then why use getPage at all? Just use getImages
        like:
        [[!getImages?
        getImages_Folder=`assets/themes/[[++site_template]]/galleries/[[*Blox.Main.Full.Gallery.Default.ID]]`
        &getImages_Ext =`jpeg,jpg,gif,png,JPEG,JPG,GIF,PNG`
        &getImages_Image_Tpl =`getImages_Image_Hidden`
        ]]

        Quote from: tezone at Jul 13, 2017, 10:41 PM
        I'm creating a gallery with paging (which works fine), the user can click the images and they open in a lightbox (swipebox) but as a page only shows the images thats being parsed through the snippet the lightbox also stops with the latest image on the page. So I made another call for all the image links so the loading of the rest of the images (on following pages, with an offset like https://forums.modx.com/thread/72386/getpage-cannot-get-offset-and-total-to-work#dis-post-432900) also can be viewed, but after a page or 2 the remaining images aren't being loaded anymore.

        It seems like it only loads the total amount (lets say 120), and then some remaining 30 and on page 3 there aren't any 'hidden' images anymore. It seems it got to do with the paging which counts down by every page, how to make sure that one every page all the remaining images (minus the offset) will be loaded? Can getPage being called two times as it seems they conflict with eachother (?). The paging snippet is only added in the first call ('getImages_Page').

        [[!getPage?
        						&elementClass=`modSnippet`
        						&element=`getImages`
        						&getImages_Folder=`assets/themes/[[++site_template]]/galleries/[[*Blox.Main.Full.Gallery.Default.ID]]` 
        						&getImages_Ext =`jpeg,jpg,gif,png,JPEG,JPG,GIF,PNG`
        						&getImages_Image_Tpl =`getImages_Image`
        						&getImages_Page_Tpl =`getImages_Page`
        						&getImages_Class =`imgThumbItem`
        						&getImages_PageClass =`imgThumbList`
        						&getImages_Id =`imgId`
        						&getImages_PageId =`div`
        						&getImages_Paging =`1`
        						&getImages_Sort=`[[*Blox.Main.Full.Gallery.Default.Sorting]]`
        						&limit=`[[*Blox.Main.Full.Gallery.Default.ThumbsPerPage]]`
        						&pageLimit=`10`
        					]]
        
        					[[!getPage?
        						&elementClass=`modSnippet`
        						&element=`getImages`
        						&getImages_Folder=`assets/themes/[[++site_template]]/galleries/[[*Blox.Main.Full.Gallery.Default.ID]]` 
        						&getImages_Ext =`jpeg,jpg,gif,png,JPEG,JPG,GIF,PNG`
        						&getImages_Image_Tpl =`getImages_Image_Hidden`
        						&getImages_Page_Tpl =`getImages_Page_Hidden`
        						&getImages_PageClass =`imgThumbListHidden`
        						&getImages_PageId =`div`
        						&getImages_Paging =`1`
        						&getImages_Sort=`[[*Blox.Main.Full.Gallery.Default.Sorting]]`
        						&initialOffset=`[[*Blox.Main.Full.Gallery.Default.ThumbsPerPage]]`
        						&limit=`120`
        					]]
        


        Thanks in advance!
          • 53484
          • 9 Posts
          Quote from: jerry325 at Jul 14, 2017, 02:02 AM
          I'm not sure that I fully understand what you are doing but I'll take a stab at it. In the second call you want all the images, right? If so then why use getPage at all? Just use getImages
          like:
          [[!getImages?
          getImages_Folder=`assets/themes/[[++site_template]]/galleries/[[*Blox.Main.Full.Gallery.Default.ID]]`
          &getImages_Ext =`jpeg,jpg,gif,png,JPEG,JPG,GIF,PNG`
          &getImages_Image_Tpl =`getImages_Image_Hidden`
          ]]


          That's indeed a possibility, but what about the offset (let's say minus the first 12 images at page one, minus the first 24 images at page 2, and so on), this is what - from what I so far found out with getImages is not possibile - but correct me if I'm wrong.
            • 14020
            • 75 Posts
            Quote from: tezone at Jul 14, 2017, 08:12 PM
            but correct me if I'm wrong.

            Nope you are not wrong. all paging functions are done by getPage. What I understood you to say is that you wanted all the images pulled so that your lightbox would have all the images for swiping back and fourth through them. I did see in another post on the getPage Thread that "solution is using &cache=`0` on every call of getPage. " but I know just about enough about getPage to make it work for what I need so I am by no means an expert.
              • 48693
              • 7 Posts
              Hello, does anyone know if there is a way to sort getImages by filename or menuindex? It seems to be making it's own order hehe
                • 14020
                • 75 Posts
                Quote from: dinglestein at Jul 20, 2017, 11:03 PM
                Hello, does anyone know if there is a way to sort getImages by filename or menuindex? It seems to be making it's own order hehe

                The default is sort SORT_ASC by filename but can be changed with the 'getImages_Sort' attribute. It uses an array_multisort on or around line 97
                  • 48693
                  • 7 Posts
                  Thanks Jerry - you da bomb! smiley
                    • 14020
                    • 75 Posts
                    Quote from: dinglestein at Jul 25, 2017, 10:14 PM
                    Thanks Jerry - you da bomb! smiley
                    Not sure about that. I just made something I wanted and then thought, why not see if anyone else was interested. Some were and even had some great ideas how to make it better. The Modx community is da bomb!
                      • 47285
                      • 4 Posts
                      Hello! I need to get ordinal number of the picture in placeholder.
                      Analog of placeholder [[+idx]] in Gallery snippet.

                      Any ideas?
                      Thanks in advance!