WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN Gallery
Code for Singlepic link in _blank (1 post)

  1. webjunk
    Member
    Posted 3 years ago #

    Am using SinglePic shortcode with Nextgen to manage banner links on some pages. Need to have most of them (but not all) open in a new window with "target=_blank"
    What I did is the following below (sorry if not perfectly clear at 4am) and it seems to work. This adds a shortcode for singlepic of "target=" Am I missing anything with this? Any way to have this implemented in a future version of Nextgen as am sure it can be useful for others and a pain to edit after updates?
    My favorite plugin!
    ------------------------

    /lib/shortcodes
    
    Before line 350
    add:
               'target'      => ''
    
    Around line 357
    change line to: (adds the $target)
    
    $out = nggSinglePicture($id, $w, $h, $mode, $float, $template, $content, $link, $target);
    
    ------------------------------------------
    /view/singlepic.php
    
    At line 43
    Change to read: (Insert: target="<?php echo $image->target ?>")
    
    <a href="<?php echo $image->imageURL ?>" target="<?php echo $image->target ?>" title="<?php echo $image->linktitle ?>" <?php echo $image->thumbcode ?> >
    
    -------------------------------------------
    /nggfunctions.php
    
    After line 1631:
    Insert:
    
        $picture->target = $target;

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.