Easy FancyBox
[resolved] Easy FancyBox, Text Widget, and NextGen Gallery (3 posts)

  1. ElementalMedia
    Posted 2 years ago #

    I have a text widget. I am using an IMG tag to place an image in that text widget.

    I want to be able to click on that image in the text widget, and open a specific NextGen gallery inside of Easy FancyBox.

    Could someone PLEASE post the example code to get this working properly???

    I have read the FAQs for both Easy FancyBox, and NextGen gallery, but I am having ZERO luck. I cannot seem to hyperlink directly to the gallery, and the gallery shortcode will not work to trigger the image in the text widget.

    Any and all assistance would be appreciated. Have a great day.


  2. ElementalMedia
    Posted 2 years ago #

    I am getting closer:
    Using this code:

    <a href="#myGallery-1" class="fancybox"><img src="http://i.imgur.com/my-image.jpg"></a>
    <div class="fancybox-hidden">
    <div id="myGallery-1" width="900" height="600">[nggallery id=1]</div>

    I am able to get the custom thumbnail, uploaded to IMGUR, to activate the lightbox and display the gallery.

    My only problem now is that its showing a small thumbnail image first, and if you click the small thumbnail image, the larger images load. I need the larger images to load, without having to click the thumbnail.

    I am familiar with the code:
    class="fancybox" rel="%GALLERY_NAME%"
    but I am not sure how I would use it properly. Would it be:

    <a class="fancybox" rel="on_set" href="???"> Dont know what the href would/should be
    <a class="fancybox" rel="set1" href="???"> Dont know what the href would/should be
    <a class="fancybox" rel=%GALLERY_NAME%" href="on_set">

    or something totally different.
    Almost there, just need a nudge in the right direction. Thanks

  3. ElementalMedia
    Posted 2 years ago #

    Solved the problem with some tinkering, and examining code from other sites.

    <a href="http://localhost/clientsite/wp-content/gallery/on_set/behind-the-scenes-01.jpg" class="fancybox" rel="set_1"><img src="http://i.imgur.com/my-image.jpg"></a>
    <div class="fancybox-hidden">
    <a href="http://localhost/clientsite/wp-content/gallery/on_set/behind-the-scenes-02.jpg" class="fancybox" rel="set_1"></a>
    <a href="http://localhost/clientsite/wp-content/gallery/on_set/behind-the-scenes-03.jpg" class="fancybox" rel="set_1"></a>
    <a href="http://localhost/clientsite/wp-content/gallery/on_set/behind-the-scenes-04.jpg" class="fancybox" rel="set_1"></a>
    <a href="http://localhost/clientsite/wp-content/gallery/on_set/behind-the-scenes-05.jpg" class="fancybox" rel="set_1"></a>
    <a href="http://localhost/clientsite/wp-content/gallery/on_set/behind-the-scenes-06.jpg" class="fancybox" rel="set_1"></a>
    <a href="http://localhost/clientsite/wp-content/gallery/on_set/behind-the-scenes-07.jpg" class="fancybox" rel="set_1"></a>
    <a href="http://localhost/clientsite/wp-content/gallery/on_set/behind-the-scenes-08.jpg" class="fancybox" rel="set_1"></a>
    <a href="http://localhost/clientsite/wp-content/gallery/on_set/behind-the-scenes-09.jpg" class="fancybox" rel="set_1"></a>
    <a href="http://localhost/clientsite/wp-content/gallery/on_set/behind-the-scenes-10.jpg" class="fancybox" rel="set_1"></a>
    <a href="http://localhost/clientsite/wp-content/gallery/on_set/behind-the-scenes-11.jpg" class="fancybox" rel="set_1"></a>
    <a href="http://localhost/clientsite/wp-content/gallery/on_set/behind-the-scenes-12.jpg" class="fancybox" rel="set_1"></a>

    Is what won the day. It seems to be a hybrid of the Manual and NextGen techniques, but as long as it works in this widget, I am happy.

    where you see
    I found the name set_1 by inspecting the element once placed on a page/post. Your gallery name will likely be different

    Hope this helps someone else out

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic