Forcing a new tab to open when clicking on a link

Mick Davidson
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 15, 2013

Hello,

Is there any way that I can force Confluence to always open the destination page in a new tab?

I know that you can change IE's settings to do this, but I want to know if this is possible in Confluence, rather than the browser. If it has to be done in the browser, then I'll have to get everyone to change their browser settings, which won't happen.

Cheers.

5 answers

1 accepted

1 vote
Answer accepted
EddieW
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 15, 2013

You can use some custom HTML to make external links open in a new window, covered by Atlassian's docs.

https://confluence.atlassian.com/display/DOC/How+to+Force+Links+to+Open+in+a+New+Window

Mick Davidson
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 15, 2013

Eddie,

thanks, that looks interesting. I'll pass it on to the senior admin and see what he has to say about it. The immediate downside is that this would be applied to the whole wiki, which might not be aceptable. If we can apply it to a specific space, that would be perfect.

I'll update my question when I find out more.

Cheers.

Mick Davidson
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 16, 2013

LOL, just found out you can open a link in a new tab using the scroll button! Which is fine, but we want to have something that works automatically so that users don't have to worry about it, it just happens.

Cheers.

2 votes
Natoe July 30, 2013

I just enabled the html and added the following line of javascript for the relevant pages.

<script>
AJS.$(".wiki-content a").attr("target","_blank");
</script>

The code above just turns the links within the wiki page defined by the css selector .wiki-content.

If you want to narrow the field of effect, just choose a different DOM parent element.

(smile)

0 votes
Jeison
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 15, 2013

Hi Mick! Not sure if you have Confluence OnDemand or standalone. For standalone, you can achieve that by adding some JS in the custom HTLM section. You'll see full instructions at https://confluence.atlassian.com/display/CONFKB/How+to+Force+Links+to+Open+in+a+New+Window

For OnDemand you won't be able to insert custom HTML.

Hope it helps!

0 votes
EddieW
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 15, 2013

I don't know of a way, but I would just comment what an awfule browsing experience if ALL links opened in a new tab. I would have 16 tabs open just looking for the info I need. http://uxdesign.smashingmagazine.com/2008/07/01/should-links-open-in-new-windows/

Opening only external links may be a valid use case, which I have answered below.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events