Forums

[Plugin: NextGen Smooth Gallery] Link to gallery page, vs. raw image (3 posts)

  1. ADBL
    Member
    Posted 1 year ago #

    Hi -

    I'm using Smooth Gallery for NGG.

    If I turn on "Embed links" in Smooth Gallery options, a click will open the image file in a new browser window. I'd like it to open the gallery page (in a new window). I don't think this is a built-in option.

    Has anyone done this? Any hint?

    TIA.

  2. Pixie_12002
    Member
    Posted 1 year ago #

    I had a slightly different problem (wanted to link each image to its own page) so I'm not sure if this will help, but the place to find the link is in nggSmoothSharedFunctions.php.

    This line is the link:
    $aux["link"] = BASE_URL . "/" . $picture->path ."/" . $picture->filename;

    If you only have one smooth gallery and you want every image to link to the same place you can hard code the URL to your gallery. eg change the above line to:
    $aux["link"] = BASE_URL . "/gallery";

    Otherwise you can use the gallery id in the link to distinguish between galleries: $picture->gid;

    The options for opening in the new window and hover text are in this line at the bottom of that file:
    $out .= " <a target=\"_blank\" href=\"" . $picture["link"] . "\" title=\"View project info\" class=\"open\"></a>";

    I know there is probably a better way to do this, but I hope it helps.

  3. lolhold
    Member
    Posted 1 year ago #

    Thanks Pixie_12002,
    changing these pieces of code work great!!!

    Exactly what I needed for my online portfolio, http://www.phgraphics.net. Now my smooth gallery is linked to my portfolio page.

Topic Closed

This topic has been closed to new replies.

About this Topic