• I’ve been searching for a way to get an image’s title or alt text to display along with the description when a user clicks on an image in NextGen gallery. I’m currently using the Shutter effect for the modal zoom.

    The description displays perfectly (using any of the effects), but no title.

    Has anyone figured out a way to add the text that is entered into each image’s “Alt & Title Text” field to the model window? Any clues would be greatly appreciated!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Anyone out there with an answer for this thread?

    Is it possible to show alttext in the modal/effect view of an individual image in nextgen?

    I’ve tried editing the view/ templates with no effect. Any suggestions?

    Would appreciate an answer very much!

    I just attempted to figure this out myself and found your thread. Here’s what I did:

    The only way I know how to do this is to edit the plugin files (which will require making the change again each time you upgrade it). This is how:

    In the nextgen plugin dir, edit the file view/gallery.php.

    Find the line of code for the anchor (link) around the thumbnail:

    <a href="<?php echo $image->imageURL ?>" title="<?php echo $image->description ?>" <?php echo $image->thumbcode ?> >

    Replace the title attribute with:
    <?php echo $image->alttext ?>

    Result:
    <a href="<?php echo $image->imageURL ?>" title="<?php echo $image->alttext ?>" <?php echo $image->thumbcode ?> >

    Explanation: The effects like the Shutter box use the anchor title attribute to display text under the image. NextGen defaults this to the description field, but the edit above will replace this default with the alttext field.

    You can leave the description code in there, too. And you can throw some HTML in the title attribute, too, as long as you escape the tag characters. For example:

    <a href="<?php echo $image->imageURL ?>" title="<b><?php echo $image->alttext ?></b><br/><br/><?php echo $image->description ?>" <?php echo $image->thumbcode ?> >

    Hmm, for some reason the “code” wrapper above didn’t show the characters as escaped. You should replace the < around the HTML tags with & lt ; (no spaces) and so on.

    Hope that helps!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: NextGEN Gallery] Adding Alt or Title text to Shutter (modal) view’ is closed to new replies.