• Resolved mvandemar

    (@mvandemar)


    I just had to solve the problem of opening up a NextGen Gallery album in a lightbox for a client (as opposed to opening it up in it’s own page first, and then clicking on a thumbnail to open the images in a lightbox), and due to the number of unanswered posts on the subject I thought I would go ahead and share my solution. This was done via a custom function, ngg’s templating system, and for what I was doing I wound up needing to use the PrettyPhoto Media plugin to get it all working nicely. First I added the following nggGetGallery() function to my client’s functions.php:

    https://pastebin.com/XW9H9ud6

    Next I created a new template inside of nextgen-gallery/view/ named album-lightbox.php:

    https://pastebin.com/rqV0JZU0

    This was based off of the album-compact.php template. The format for adding galleries is now:

    [album id=7 template=lightbox]

    This worked great, aside from the fact that with multiple albums on a single page it would treat them all as a single gallery. I solved this by installing the PrettyPhoto Media plugin:

    https://www.ads-software.com/extend/plugins/prettyphoto-media/

    Then I went to Gallery -> Options -> Effects, changed the dropdown to Custom, and added this code:

    rel=”prettyPhoto[%GALLERY_NAME%]”

    And voila, it all worked. I hope this helps someone else looking for a solution to that.

    -Michael

    https://www.ads-software.com/extend/plugins/nextgen-gallery/

Viewing 15 replies - 46 through 60 (of 74 total)
  • oh sorry – mean NextGEN Plugin … and yes – have the latest version – just installed last weekend ??

    Anyone have the code to do the same “Open album in lightbox” in extend mode?

    I too am very interested in displaying an album in extended mode while the individual galleries are displayed using lightbox. My current code for the album is [album id=1 template=lightbox].

    I followed your directions, @mvandemar but I am not getting the photos to stack on top of each other as yours is. I added the code to functions. I created the new template, installed prettyPhoto Media, changed effects to custom and added the template to the shortcode when calling gallery or album. I want to build this page like you have the the dentist photo gallery page.

    Gallery Page

    Thread Starter mvandemar

    (@mvandemar)

    @markali – fire me an email with the details and I will take a look. My email address is in an earlier post.

    @javieruy & @finkdb – it’s been a while since I worked on this, or any site with NextGen installed, I will have to set up a dev site and play with it to see what you are asking for. Do either of you have a link to an existing gallery, so I can see the difference?

    @mvandemar – I just sent you an email at the address you listed in a previous post showing both the Lightbox album thumbnails and the Extend album thumbnails. Thanks for looking at this.

    @mvandemar, thanks man! Now after the custom effects to prettygallery I really like the new look of my nggallery slideshow.

    @mvandemar – sent you email yesterday, I just want to have the stacking effect to my galleries.

    I think I figured it out.

    Change mvandemar’s album-lightbox.php file to reflect the following changes.
    1) Change Line 22: replace ngg-album-compact with ngg-album
    2) Change Line 23: replace ngg-album-compactbox with ngg-album

    This worked for me. Now I have an album in extended view that displays a thumbnail of each gallery. When each thumbnail is clicked, the respective gallery opens in Lightbox.

    @finkdb Did you add the code to the functions.php? I had trouble with that in that it crashed my site.

    @marali – No, I changed the album-lightbox.php file.

    Well, now my page is only showing a blank gallery stacked image and no copy. This just doesn’t seem to work for me. Here is the page now
    https://sheldrakeyc.org/gallery/

    It looks like you are still linked to the Compact and not the Extend format. When you copied mvandemar’s code for functions.php and album-lightbox.php, did you grab the RAW code? If not, do that. The additional function in the functions.php file should not have crashed your site. Also, are you trying to display an album with multiple galleries or just a single gallery?

    When I copy over the raw functions code, I get the code at the head of my page as well as across the top of wp admin. I’m putting this code in the theme functions not nextgen functions, correct?

    https://sheldrakeyc.org/gallery/

    Take the raw code for functions.php and paste it in your theme’s functions.php file. Make sure you scroll down and get all of the code when you copy it. I don’t understand your statement, “I get the code at the head of my page as well as across the top of wp admin”. What code are you seeing? It may be better for us to take this off of this board. Please email me directly at [ redacted, support is offered via the forum and not email ]

Viewing 15 replies - 46 through 60 (of 74 total)
  • The topic ‘[Plugin: NextGEN Gallery] [NextGen Gallery] Open album in lightbox’ is closed to new replies.