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.