WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN Gallery - edit link of photo to specific post? (25 posts)

  1. osones
    Member
    Posted 6 years ago #

    Hi,

    I'm all fairly new to this so sorry if my question seems a little simple!

    I've created a gallery and have inserted into a new page. When I click on one of the thumbnails it takes me to the photo location.

    Is there a way, instead of taking me to the photo location, can I link a post to the photo?

    Any ideas would be most grateful!

  2. xurbia
    Member
    Posted 6 years ago #

    I have just added nextgen gallery and have wondered the same thing.
    Is there a way of linking an image to a specific post?

  3. Rodeo Imagination
    Member
    Posted 6 years ago #

    I am starting to examine the code also... I'd like that instead of taking me to the photo location, it would take me to the Photo single page where visitors can comment over it...

    Anyway?... any of you have managed to get the effect working? It redirects me right to the image url and doesn't open inside the browser as I've seen in all the example pages...

  4. Alex Rabe
    Member
    Posted 6 years ago #

    It's all inside nggfunctions.php, currently it's not possible by default

  5. 303luxury
    Member
    Posted 6 years ago #

    i have been trying to do the same thing and searching all over the net for a plugin that will do it.

    I have a slideshow of house pics. When a visitor clicks i want the link to go to a detailed page of the property. HOW DO I DO THIS???

    Please help

  6. ilovephotoblogs
    Member
    Posted 6 years ago #

    I have the same question about linking to a specific page. I am using nextgen to display screen shots of photoblogs and would like to have the ability to link gallery image to specific website. I see where you state "It's all inside nggfunctions.php"...which is fine if I knew what I was doing. If someone could shed a little light how to do this, within the php file, it would be much appreciated.

  7. joaopott
    Member
    Posted 6 years ago #

    HI anyone? no ideas?
    I m using pot thumb revised to do that, but i really would like to use just nextgen, its much better in my opnion...
    Please someone can teach how to change the link to the post instead the picture?
    Thanks to all anyway :-)
    and best regards from joao (Brazil)

  8. osones
    Member
    Posted 6 years ago #

    Joao,

    What do you mean by 'pot thumb'? Is this a plugin or something that is editable?

    Cheers,

    Oli

  9. Parap
    Member
    Posted 6 years ago #

    I'd like to say that trick is just a logical game, no particular php skills are required.

    As a foreword, I found some posts near here an infuriated guy giving me reprimands on forum protocol, while I was expecting to some cool feedback, so I let he reconsiders different ways to adress to strangers and I post it here.

    You can use this trick to obtain, in NextGen Gallery, some of the thumbnails of your choice link to an URL : a post, a page, a file to download, whatever.

    1- Extract a copy of NextGen to your Desktop.

    2- Open the nggfunctions.php

    3- Go to line 338.

    4- There you have by default:

    // choose link between imagebrowser or effect
    $link = ($ngg_options['galImgBrowser']) ? $nggRewrite->get_permalink(array('pid'=>$picture->pid)) : $folder_url.$picture->filename

    Take a look at the end of the phrase. $folder_url.$picture->filename
    That will displays your thumbs, towards its full size. The code is telling the thumbnail that its final URL be the images path $folder_url. plus the filename , which convokes the concrete image.

    Erase one and other and let just $picture-> .

    5- now, add " alttext " at the end:

    // choose link between imagebrowser or effect
    $link = ($ngg_options['galImgBrowser']) ? $nggRewrite->get_permalink(array('pid'=>$picture->pid)) : $picture->alttext;

    That will display later in your Admin Panel whatever in the Alt & Title Text field be written, e.g. an URL. Maybe if you write 'Andromeda' a cosmic gate opens in your screen.

    6- Save it.

    7- To prevent later your thumbnail shows the typical alt text as a weird URL when you place your mouse over the image, go to line 348.

    There you have:

    $out .= '<img title="'.stripslashes($picture->alttext).'" alt="'.stripslashes($picture->alttext).'" src="'.$thumbnailURL.$thumb_prefix.$picture->filename.'" '.$thumbsize.' />';

    Remove the code '.stripslashes($picture->alttext).'
    Be careful with every little comma.

    You must get that:

    $out .= '<img title="" alt="'.stripslashes($picture->alttext).'" src="'.$thumbnailURL.$thumb_prefix.$picture->filename.'" '.$thumbsize.' />';

    So nothing inside the title="" order.

    In IE the alt text just disappears. In Firefox, you'll get your description showing up. Don't ask me why. Maybe the browser search for the closer alternative.

    8- Save it, close the editor, and open your FTP.

    9- Upload just one file, this new and pretty modified nggfunctions.php, to your host, in the Next-Gen Gallery plugin directory, to overwrite the default file.

    10- go to your Admin Panel. In Gallery - Options - Gallery, select 'show thumb description = description text' (Update.)

    11- Go to any of your galleries. Assign like always a description for every thumbnail (its title, a paragraph, etc) and, in the alt & title field, THE URL YOU WANT TO BE LINKED.

    Check for that purpose your own pages and posts.

    Visit your site. Now it's when all your CSS style it's completly broken.

    I don't know an easier way to do it.
    Tell me if that worked for you ;)

  10. level.five
    Member
    Posted 5 years ago #

    Hi Parap, you saved my day. Thanks a lot for posting your solotution. It works fine for me - great work. best jan

  11. hotforwords
    Member
    Posted 5 years ago #

    Parap,
    Do you know how to make the images clickable in the flash slideshow?

    The flash slideshow viewer (Image Rotator) I know allows for that.. but it requires a link to be added to each image in the XML file.. but I don't know how to make that happen with next-gen gallery.

    Thanks so much!

    Marina

  12. Ariane Griffiths
    Member
    Posted 5 years ago #

    I'm interested in this too; i would like my slideshow (in my sidebar) to be clickable so that when you click on the image, you get taken to the location of that image/post.
    Thanks,
    A

  13. beernews
    Member
    Posted 5 years ago #

    Did anyone else not get Parap's solution to work?

    As an alternative, is there a way to link to a post in the description and have the description display under the preview image?

    edit: Note that I'm trying to get this to work on the sidebar. For whatever reason, there is so much additional functionality only when putting into a post. I'll look into it in the AM

  14. mothnyc
    Member
    Posted 5 years ago #

    Parap's solution got me almost there...

    What I'm going for is a grid of images (magazine covers) that link to urls (pages hosting all the articles from each issue). Paraps solution enabled me to link each image with a webpage, but unfortunately, those webpages are coming up inside the image rotator. Is there anyway to get a direct link?

  15. beckhamlkc
    Member
    Posted 5 years ago #

  16. tdanyo
    Member
    Posted 5 years ago #

    How do you make this work in version 1.0.2? I tried doing this, but the code mentioned is not present in the newer version.

    I am trying to link a thumbnail image to a URL. I am using WP 2.7.

    Thanks!

    Tim

  17. goodenvy
    Member
    Posted 5 years ago #

    nextGEN Version: 1.0.2 for the Web2.0 (the latest as of Jan.09)

    I have a visual and step by step tutorial for this:

    http://home.yourconame.com/nextgen-linking-image-to-url/2009/archives/

    Thanks to beckhamlkc for the light of leading.

    ~Adrie Silva
    http://www.silvaprints.com

  18. johnwoo
    Member
    Posted 5 years ago #

    Hi,

    I want this to get working with the flash image rotator. so when I click on an rotating image it will follow the link added as alt text. I allready made a custom code to use the alt text as link but only when it is for example gallery id 2. So other galleries are not affected. Is it possible to add this functionality to the Flash rotator or does JW need to alternate his actionscript in the SWF file?

    If not possible right now, I think this would be a very nice feature for upcomming versions of NEXTGEN or the JW Image Rotator.

    Greetz, John

  19. tdanyo
    Member
    Posted 5 years ago #

    Adrie,

    I tried your suggestions and nothing. The thumbnail still links to the imageURL and not the page URL discribed in the alltext area. Could you please cut and paste what the finished gallery thumbnail code is? I appreciate your tutorial, but something got lost in translation.

    Thanks
    Tim

  20. goodenvy
    Member
    Posted 5 years ago #

    Hey tdanyo did you get your solution yet?

    If you look at my hardware page you see the thumbnails link to an outside support page (outside URL)..

    Um.. I'm using nextGen version 1.0.2 Let me know.

    http://yourconame.com

  21. tdanyo
    Member
    Posted 5 years ago #

    "If you look at my hardware page you see the thumbnails link to an outside support page (outside URL).."

    goodenvy,

    I plugged in your exact code and the link is still directed to the imageURL and not the altext url associated with the particular thumbnail. This is the code:

    <!– Thumbnails –>
    <?php foreach ($images as $image) : ?>

    <div id=”ngg-image-<?php echo $image->pid ?>” class=”ngg-gallery-thumbnail-box”>
    <div class=”ngg-gallery-thumbnail” >
    alttext ?>” title=”<?php echo $image->description ?>” <?php echo $image->thumbcode ?> >
    <img title=”Link” alt=”Link” src=”<?php echo $image->thumbnailURL ?>” <?php echo $image->size ?> />

    </div>
    </div>

    Yes. I see the thumbnails on your hardware page and that is what I am trying to do. I am using the 1.1.0b version. Maybe this is to blame? It shouldn't though because all of the code is identical except the code we are switching out.

    This is really frustrating.

    This is my test page:

    http://imaginationmedia.tv/services/test

    You can see how the thumbnails are behaving. The DVD icon in the main text area is the one I want to link to another url and not the image url.

  22. beckhamlkc
    Member
    Posted 5 years ago #

    tdanyo, i had a peek at:
    http://imaginationmedia.tv/services/test

    and found that you have not updated your alttext field in your images' gallery... go to Gallery-->Manage Gallery--><your gallery>

    <!-- Thumbnails -->
            <?php foreach ($images as $image) : ?>
    
            <div id="ngg-image-<?php echo $image->pid ?>" class="ngg-gallery-thumbnail-box">
                    <div class="ngg-gallery-thumbnail" >
                            <p>
                            <a href="<?php echo $image->alttext ?>" title="<?php echo $image->description ?>" <?php echo $image->thumbcode ?> >
                                    <img title="<?php echo $image->description ?>" alt="<?php echo $image->alttext ?>" src="<?php echo $image->thumbnailURL ?>" <
    ?php echo $image->size ?> />
                            </a>
                            <a href="<?php echo $image->alttext ?>"><?php echo $image->description ?></a>
                            </p>
                    </div>
    
            </div>
            <?php endforeach; ?>

    this is my version of the code... copy it exactly to your gallery.php (thumbnail portion) and update each image's alttext field(one liner textbox) with the URL you want to redirect to and each image's description field(multiple lines textbox) with text to appear when mouseover-ing the thumbnail.

    ~cheers~

  23. foofyfun
    Member
    Posted 5 years ago #

    @ Parap thanks!!!!! This was exactly what I was looking for! It saved me lots of time. I do have a small q...Is there a way to open the URL(s) in a new window using this method? When I use this method the URL opens in the same window. Any help would be welcome...

  24. faidonas
    Member
    Posted 5 years ago #

    Johnwwo,
    can you share how you did it for the slide show? I 've been looking for that for a long time...
    Thanks

  25. masshoff
    Member
    Posted 5 years ago #

    +1 - would like to know about a mod for the SLideshow to link to individual pages.

Topic Closed

This topic has been closed to new replies.

About this Topic