How to make confluence links all open in new window

Chi Nguyen March 27, 2016

Hi Atlassian,
 

We want to insert links to external websites in my page and have them open up in a new window. (It's not just ctrl+click).

We want all links to open in a new tab, window. Please support us.
My Confluence 6.0.0-OD-2016.12.2-1113.

Thanks so much,
Chi 

 

2 answers

0 votes
Carlos Gomez November 29, 2017
0 votes
Alex Yasurek
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.
March 28, 2016

Hi,

You can add some javascript to apply the target="_blank"  attribute to all links so that they open up in a new window. If you want to target only links that lead to external sites, you can use the class ".external-link" which confluence applies to all links that are external.

For example, add something like this to the custom HTML section in the admin area:

 AJS.$(".external-link").attr("target", "_blank");

 

 

Steven F Behnke
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.
March 28, 2016

The user indicates with labels they are on Confluence Cloud – Custom HTML and jquery is not an option.

Alex Yasurek
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.
March 28, 2016

Oh good point, didn't see that. Not sure how it can be done globally without Javascript then.

Milo Test
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.
March 28, 2016

 I also don't know of any way to do it in cloud. So you might want to vote for this: https://jira.atlassian.com/browse/JRA-9380

Debbie Lefkowitz September 13, 2016

you can't, we've all been sent back to 1997.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events