By modifying templates I am able to display more than one gallery on a page. The key lies in the "rel" attribute of the a tag:
Originally:
rel="lightbox[maxigallery]"
changing to this gives each gallery call on a page a unique ID, or at least it does for most instances.
rel="lightbox[set[+maxigallery.picture.gal_id+]]"
Here are some examples of where this fails:
1. You call a single image from a gallery to display as inline content with a text wrap, and further down on the page you show the entire gallery. If you want a slimbox display for both the single image and the gallery, clicking on the single image will bring up slimbox with all the images from that gallery, since the rel attribute for the gallery on the same page is the same.
2. You’d like to break up a large gallery into smaller chunks, showing images 1-10, and then using $offset=`10` MG parameter to show the next 10 images in a separate gallery. Again, all images will show up.
It seems to me that, by default, each maxiGallery snippit call could assign a unique ID to the rel attribute to ensure that each call produces it’s own gallery. As an option, a &galID=`` option could be made available for the (rare?) case where you’d like multiple MG instances on a page to show the same slimbox contents.
I’m wondering if there is a simple workaround for this.
For the single image case you can simply replace the galleryID with the pictureID in the rel atttribute in a custom Gallery Picture Template. In other words, replace [+maxigallery.picture.gal_id+] with [+maxigallery.picture.id+] in the rel attribute. (Writing posts to the forum is a good way to problem solve.) However, this does not help if you want to show the same image more than once on a page, though that’s a more esoteric case.
So, what about multiple calls to the same gallery?
Revo 2.0.8-pl
You can add a gallery id parameter by adding following in maxigallery.php:
$mgconfig[’callid’] = (isset($callid)) ? $callid : "maxigallery"; // [ text ]
Then in your snippet calls, use &callid=`someidentifiertext` and in maxigallery templates use [+maxigallery.config.callid+]
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
Thanks Doze!
I suppose even better would be to set the default value to a random number (say between 1 and 10,000,000), rather than to "maxigallery". In this way the galleries are automatically kept separate. While this leaves only 1 chance in 10million that you’d end up with the same ID for two galleries on a page, perhaps storing and incrementing the last-used ID would be even better, but maybe that’s just overkill... I’ll implement something and see how it goes.
Revo 2.0.8-pl