Multiple NextGen Gallery Albums per page
-
(This was previously reported privately to Imagely support, but nonetheless, they requested this be publicly posted, so it is being posted here.)
So, after getting the style we wanted… we found a couple of bugs.
One is minor, and should be relatively easy to fix… if you click on one of the galleries in the album, when the page reloads, it sends you to the top of the page. This is jarring for the user.
I think generating an
<a name="nggallery-${idx} />
tag just before the gallery/album HTML itself, and ensuring every gallery link is suffixed with#nggallery-${idx}
, would solve this.The second one though, is much more serious. For this, I quickly slapped together a demonstration. This is a bare-bones WordPress install, done yesterday morning, with no themes or plug-ins except the Imagely theme, and the NextGen Gallery, NextGen PRO plug-ins.
I’ve created four galleries, stored in two albums. (Note, the photos are not terribly high resolution — I use these for slow-scan television on amateur radio, where the “standard” is 320×240px.)
Now, this page has two “album” blocks on it:
- Animals
- Landscapes
For the sake of testing, I selected “Pro Film” style for the galleries on this page.
Animals has two galleries: “Sam the cat” and “Wildlife”. These function just fine. No issues. Aside from the issue above where it sends you to the top of the page, they work well.
The second one has two other galleries: “St. Helena Island” and “Snowy Mountains”. Its behaviour, despite an identical configuration (aside from selected album), is very different.
These work, but when you “enter” one of these galleries, the gallery appears under the heading “Animals”.
Now… on the actual site we want to use the “Pro Tile” gallery style. I made a second page showing what happens when you do this.
https://albumtest.vk4msl.com/index.php/pro-tile-gallery-testing/
Same set-up, just I changed the gallery style in each album block.
The “Animals” galleries, work as they should.? Pro-tile works great despite all of these being low-resolution 4:3 aspect ratio photos.
The “Landscapes” galleries break rather badly.? Enter one of those, and all galleries disappear.
There’s no browser errors, this appears to be an issue in the PHP back-end code.? I’ve attached the Apache web server error log.
My hunch is this:
– when a user clicks on a gallery, they are taken to a URI constructed from this template: ${PAGE_URI}/nggallery/${GALLERY_SLUG} (where ${PAGE_URI} is the URI of the page, and ${GALLERY_SLUG} is the gallery title with all non-URL-safe characters substituted).
– the PHP code sees the ‘nggallery’ sub-path in the URI… the *first* NGGallery block tries to interpret it.
– First NGGallery block looks through its galleries (from the “Animals” album), can’t find one with a matching slug, silently fails.
– Due to state corruption by the first NGGallery block, the second NGGallery also fails.
“Pro Film” seems to almost work fine… it seems the first NGGallery block is interpreting the query.? “Pro Tile” appears to not handle this as gracefully (maybe some shared state?) and so when the first instance fails, it leaves variables in a bad state that means all subsequent NGGallery blocks fail to render properly.
Site information:
– Hosting environment: PHP 8.1, Apache httpd 2.4.59, MariaDB 10.11.6, AlpineLinux 3.19 (Imagely support: see phpinfo.html emailed to you yesterday)
– WordPress 6.5.2 (downloaded yesterday morning)
– Imagely theme 2.3.0 (installed from downloaded ZIP)
– NextGen Gallery 3.59.2 (installed from downloaded ZIP, then updated through WordPress dashboard)
– NextGen Pro 3.31.2 (installed from downloaded zip, then updated through WordPress dashboard)
ZIP file hashes of plug-ins (SHA-256):
e2d0099b7b668693e6509904b1cc921d0bbd9740a07ebf546bec1d738c0565bf imagely-v2.3-4740865ebff87963e5.zip
9dd8dba247320b4a5736c48866a07eccf2520aeb7388236989b10743aa6cafc1 nextgen-gallery.zip
1b241e6da4e47030e021134eae9f42c4a1205ef091b2bcb5bfd5f517f3e8e84e photocrati-nextgen-pro-3.31.1-4740865ebf92578d21.zipThe page I need help with: [log in to see the link]
- The topic ‘Multiple NextGen Gallery Albums per page’ is closed to new replies.