We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7515
    • 10 Posts
    I have a gallery with pagination using lightbox. It displays 6 images per page, and currently 3 pages worth of pictures (13 images). When I click a thumbnail, lightbox comes up and will allow me to scroll to 6 images on the current page, only. I want to be able to scroll all the way back and forth to all images in the gallery. How can I do this? I have heard mention that these might be called photosets and lightbox supports them. I’m not sure where to look.

    Here is my maxigallery calll:
    [!MaxiGallery? &display=`embedded` &embedtype=`lightboxv2` &pics_per_row=`3` &pics_per_page=`6` &random_filenames=`1` &max_thumb_size=`200` &max_pic_size=`600` &max_big_size=`600` &thumb_use_dropshadow=`1`!]


    Here is the site:
    http://monicatsao.com/jewels.html

    Thanks!
    Cory
      • 4172
      • 5,888 Posts
      Cory you need a second hidden maxigallery with all pictures, have a look here:
      http://wiki.modxcms.com/index.php/MaxiGallery#One_thumbnail_in_page.2C_but_all_pics_in_Slimbox.2FLightbox_v2_picture_set

      Bruno
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 7515
        • 10 Posts
        Thank you! This is almost working perfectly. I duplicated the templates on that link and lightbox displayed all images.

        It also displayed two manager buttons, and upon management, two management forms with two sets of all pictures. I resolved this by making a blank chunk (Gallery Manage tpl hidden): <!-- This chunk left blank intentionally -->
        And calling it with these parameters:
        &manageButtonTpl=`Gallery Manage tpl hidden` &manageOuterTpl=`Gallery Manage tpl hidden`

        I’m displaying 6 images on each page. When I clicked an image, it displayed the first six twice before moving on to the next page. I fixed this by adding an &offset=`6`.

        Now it is almost functioning as it should. From the front page everything is fine. The first 6 images are the current page, the second 6 are the second page, etc. However if I start lightbox from page 2 or 3, again the first images are the current page, the second 6 are page 2, the third are page 3, the fourth page 4.

        How can I fix this?

        [!MaxiGallery? &display=`embedded` &embedtype=`lightboxv2` &pics_per_row=`3` &pics_per_page=`6` &max_thumb_size=`200` &max_pic_size=`600` &max_big_size=`600` &thumb_use_dropshadow=`1` &galleryPictureTpl=`Gallery tpl` !]
        [!MaxiGallery? &display=`embedded` &embedtype=`lightboxv2` &limit=`99999` &offset=`6` &galleryPictureTpl=`Gallery tpl hidden` &manageButtonTpl=`Gallery Manage tpl hidden` &manageOuterTpl=`Gallery Manage tpl hidden` !]
          • 7515
          • 10 Posts
          Wow, having two galleries also gives me parse errors like this when posting new images. The images post and the thumbnails are created, but this error pops up. If I comment the line, it has a problem with a getimagesize function.

          « MODx Parse Error »
          MODx encountered the following error while attempting to parse the requested resource: 
          « PHP Parse Error » 
            
          PHP error debug 
            Error:  chmod() [function.chmod]: No such file or directory   
            Error type/ Nr.:  Warning - 2   
            File:  /home/adaptabl/public_html/www/monicatsao/assets/snippets/maxigallery/maxigallery.php   
            Line:  372   
            Line 372 source:  chmod($mg->path_to_gal.$name,0666);    
            
          Parser timing 
            MySQL:  0.0047 s (1 Requests) 
            PHP:  0.0515 s   
            Total:  0.0562 s   


          If I take the second gallery it allows me to post in the manager, but then it won’t display all the images in the lightbox! huh
            • 7515
            • 10 Posts
            OK, I was able to find a workable solution. Not ideal, but pretty good. I can get all the images in the lightbox. There are no duplicates, no matter which page I start on, and I can upload and manage pictures as expected in the gallery. The only missing functionality piece is when on the second page, when I start the lightbox I can only display images from that page to the end. I.e. If there are 18 pics total at 6 per page, if I click on the second picture on the second page, it should be 8 out of 18, allowing me to go all the way to 1 or 18. Instead it is 2 of 12, and allows me to go from the beginning of the current page to the end. Not ideal, but acceptable. Any idea how to get the full set? (ie show 8 of 18?)

            Here is my current setup.
            MODx 0.9.6.2; MaxiGallery 0.5.2

            My calls to the galleries are in a snippet so I can calculate the offset, and remove the 2nd gallery when using the gallery manager.

            This goes in my document: [!Gallery!]

            This is the Gallery snippet:
            <?php
            /**************************************************************************************************
            * Gallery
            *
            * Calls MaxiGallery w/ a hidden maxigallery to display all images inside a lightbox
            *
            **************************************************************************************************/
            // First gallery parameters
            $params1['display'] ='embedded';
            $params1['embedtype'] = 'lightboxv2';
            $params1['pics_per_row'] = '3';
            $params1['pics_per_page'] = '6';
            $params1['max_thumb_size'] = '200';
            $params1['max_pic_size'] = '600';
            $params1['max_big_size'] = '600';
            $params1['thumb_use_dropshadow'] = '1';
            $params1['galleryPictureTpl'] = 'Gallery tpl';
            
            // Hidden gallery parameters
            $params2['display'] = $params1['display'];
            $params2['embedtype'] = $params1['embedtype'];
            $params2['limit'] = '99999';
            $params2['galleryPictureTpl'] = 'Gallery tpl hidden';
            $params2['manageButtonTpl'] = 'Gallery Manage tpl hidden';
            //$params2['manageOuterTpl'] = 'Gallery Manage  tpl hidden';
            // Offset images by the number of pages we are on, so it will display only from this page to the end, but with no repeating
            $params2['offset'] = ($_REQUEST['page']) ? $_REQUEST['page'] * $params1['pics_per_page'] : $params1['pics_per_page'];
            
            
            // Run first gallery
            $output = $modx->runSnippet('MaxiGallery', $params1);
            
            // Print second gallery unless managing the pictures
            if( $_REQUEST[mode] != "admin" ) {
               $output .= $modx->runSnippet('MaxiGallery', $params2);
            }
            
            $output .= '<br style="clear:both" />';
            return $output;
            
            // Above is equivalent of this:
            // [!MaxiGallery? &display=`embedded` &embedtype=`lightboxv2` &pics_per_row=`3` &pics_per_page=`6` &max_thumb_size=`200` &max_pic_size=`600` &max_big_size=`600` &thumb_use_dropshadow=`1` &galleryPictureTpl=`Gallery tpl` !]
            // [!MaxiGallery? &display=`embedded` &embedtype=`lightboxv2` &limit=`99999` &offset=`6` &galleryPictureTpl=`Gallery tpl hidden` &manageButtonTpl=`Gallery Manage tpl hidden` &manageOuterTpl=`Gallery Manage tpl hidden` !]
            //<br style="clear:both" />
            ?>


            Gallery Manage tpl hidden is this: <!-- Intentionally blank -->
            The other templates are according Bruno’s wiki link above.
              • 7923
              • 4,213 Posts
              a "correct" way to implement picture management when multiple calls are on a single document is to use the &manage_target and &is_target parameters...


                "He can have a lollipop any time he wants to. That's what it means to be a programmer."