The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

NextGEN Monoslideshow
using dynamic information from nextgen gallery custom fields (5 posts)

  1. lucascorato
    Posted 5 years ago #

    Hi everybody,

    It's been a while I've trying to find a way to add links to images in wordpress with this plugin.

    So far, I managed to do the following:

    1. installed the nextgen custom fields plugin
    2. created a custom field called "Image links to"
    3. Added a specific info to each picture, in this case a URL (although the field is text only)

    Much of it I found here: http://www.hackingethics.com/blog/2010/08/02/how-to-add-custom-fields-in-nextgen-gallery-to-give-link-on-images-of-posts-or-page/

    So, my question is: now that I have this dynamic information somewhere, how to I take it to my xml.php in the monoslideshow plugin?

    I tried to add the following, between the blank lines, but with no success:

    if (is_array ($pictures)){
    	foreach ($pictures as $picture) {
            $description = htmlspecialchars ( strip_tags( stripslashes( nggGallery::i18n($picture->description) ) ) , ENT_QUOTES );
            if (!empty($picture->alttext))
                $title = stripslashes( htmlspecialchars (nggGallery::i18n($picture->alttext) , ENT_QUOTES) );
                $title = $picture->filename;
                $link = $image->ngg_custom_fields["Image links to"];
            $path = $siteurl . '/' . $picture->path . '/' . $picture->filename;
            $thumbnail = $siteurl . '/' . $picture->path . '/thumbs/thumbs_' . $picture->filename;
            echo "\t\t<image id='$picture->pid' source='$path' title='$title' link='$link' description='$description' thumbnail='$thumbnail' />\n";

    I really think this is the way to go, since if I add a static adress like:

    $link ='http://www.google.com'

    It will indeed take me to google but from every image. I need to know what string to use so that the xml.php gets the right information - which by the way I don't know where it comes from, if it's a file in the nextgen gallery plugin or what...

    I guess it's just a last step to get this thing done.

    Ah, the gallery is here: http://fot.lucascorato.com/category/360


    Thanks for your time.


  2. plymouthdesign
    Posted 5 years ago #

    Here's the solution. The changes to the xml.php file are highlighted.

  3. lucascorato
    Posted 5 years ago #

    Thanks a lot plymouthdesign!
    I'll give it a try and let you know about the results!
    I'm sorry I didn't reply before, I've been flooded with work and only now I can get back to my website!

  4. lucascorato
    Posted 5 years ago #

    Amazing, it works really well!
    Going one step further, how can I make it to open the links on a new window?
    Thanks again

  5. empulse
    Posted 4 years ago #

    I'm sure this is a ridiculous longshot, but I desperately need the info linked above by plymouthdesign on adding hyperlinks to nextgen gallery monoslideshow. Sadly, the above link is down.... Does anyone happen to know of another location to find this info?


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • NextGEN Monoslideshow
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic