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

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.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

2,641 views 25 10
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