Adding a URL to a photo

hwilliam

Joined: 2008-04-05
Posts: 21
Posted: Sat, 2012-07-14 16:25

Is there a way when adding a URL address to a photo to get the new page to come up in either a new tab or window?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2012-07-14 21:48

I don't understand.
If you install the html_purifier module, you can add links to the description.
http://codex.gallery2.org/Gallery3:Modules:purifier

there is the http://codex.gallery2.org/Gallery3:Modules:item_links module as well.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Sat, 2012-07-14 22:58

I don't really get the question either.
If you already added the html code and are trying to figure out how to force a new tab/window, add a target. For example: <a href="website.com" target="_blank">anchor text</a>

 
hwilliam

Joined: 2008-04-05
Posts: 21
Posted: Tue, 2012-07-17 02:52

Guess I wasn't clear.. When you go to options on a photo and select Edit Photo....one of the options is Redirect to URL When you do that then when you click on the photo in the Gallery (3) it then opens the new url in the same window. I would like to have it open the new url in a new window or tab. Example...go to http://www.naturephotographybyhwilliam.com/gallery3/Sunrise-Sunsets and click on any image. You will see it loads the new page in the same window so to return to the gallery you have to use the back arrow.

 
eugenedugan

Joined: 2012-07-17
Posts: 1
Posted: Sat, 2012-08-04 08:53

Try to edit the html code of the image by adding this
<a href="http://www.naturephotographybyhwilliam.com/gallery3/Sunrise-Sunsets" target="_blank">anchor text</a> then it will be directed to the said site once you click the image.

employment screening

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2012-07-17 04:29
Quote:
one of the options is Redirect to URL

What module is that?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
hwilliam

Joined: 2008-04-05
Posts: 21
Posted: Tue, 2012-07-24 16:53

Thank you all for your comments and ideas. What I am looking at is not a module. When you go to the gallery, open an album and click on "Edit Photo" on one of the images you get a screen that says "Title", "Description", "File Name". "Internet Address" "Tags" and "Redirect to URL" When you enter a url address there are no options to add target="blank" or anything like that. Do I have to find wherever this screen is located and edit it so it automatically adds "Target="blank"?

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Tue, 2012-07-24 17:57

using jQuery you can have all external links automatically open in a new window

$("a").filter(function(){
    return this.hostname && this.hostname !== location.hostname;
}).each(function(){
    $(this).attr({
        target: "_blank"
    });
});

add this to your theme's views/page.html.php in the document.ready function

-s