[Plugin: NextGEN Gallery] Custom page template (not *gallery* template) for albums and galleries
A little bit of introduction.
I have a WP installation with three plugins: NGGallery (duh), EasyFancybox (for lightboxes) and WordPress NextGen GalleryView, which provides a filmstrip-like gallery visualization.
What I want to achieve sounds pretty easy in theory, but it proved to be very hard: all of my galleries are in an album. The editor adds new galleries to that album. I have a “galleries” page in the homepage which only includes [album id=1], so it’s automatically updated when new galleries are added.
When the user clicks on an album a lightbox opens, and the album is viewed with the GalleryView template. Simple, huh?
I created an album template which adds to each gallery the “fancybox-iframe” class, so I get the fancybox. I also created my-theme/nggallery/gallery.php so that it automatically uses the galleryview template (because there’s no way to select the gallery template to use from the album shortcode, but there aren’t also any options to select a default template, so it has to be used manually… and this is another collateral question I’d like to get an answer to 🙂 ).
But here’s the tricky part: how can I create a custom post template which matches the galleries and not the album page, so that I can filter out all the part of the site I don’t want in the lightbox (heading, menu, sidebar…).
At the moment I’m using an ugly hack: I disabled gallery slugs in NGG so that the generated gallery (which is created on the fly, remember that the editor doesn’t have to create a gallery post for each gallery she adds) has the same url of the album page.
Then I created a custom page template which checks if $gallery and $album are set (as I saw they are passed in a GET by NGG), and with a horrid “if” statement understands if we are on the album page (full template) or on a gallery page (no content but the galleryview).
I’d like to use slugs, but if I do there’s no way to get a template to apply since the page name isn’t matchable and there are no other common elements to understand if we’re on a gallery page or on anything else because it’s all dinamically generated by NGG.
So, is there any parameter I’m missing that I could use to infer I’m on a gallery page? Or any other kind of way that NGG provides to change the page layout for galleries? Anb maybe it would be useful for albums too…
Ok, this was very long, but also rather complicated to explain. I hope everything is clear, if not just ask and I’ll try to do better 🙂 Thanks for getting through here!
- The topic ‘[Plugin: NextGEN Gallery] Custom page template (not *gallery* template) for albums and galleries’ is closed to new replies.