How to make confluence links all open in new window

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

This widget could not be displayed.

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 Behnke Community Champion Mar 28, 2016

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

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

 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

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

This widget could not be displayed.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Monday in Confluence

Why start from scratch? Introducing four new templates for Confluence Cloud

Hi my Community friends!  For those who don't know me, I'm a product marketer on the Confluence Cloud team - nice to meet you! For those of you who do, you know that I've been all up in your Co...

293 views 2 4
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you