How can I get links to open up in a new window on Confluence?
Asked by Rita Kumar:

I want to insert links to external websites in my page and have them open up in a new window. I am in the on demand version... Please give me some solutions...

<br />

Thank you


Answers:
author: Davin Studer
body: There is no automated solution for this with ondemand. You can ctrl+click the links and they will open in new windows, but that is the only way that I know of right now.

comments: author: Rita Kumar
body: Thanks David.. that does help so I can either right click or ctrl +click.. better than nothing


author: Chi Nguyen
body: Hi Atlassian,  
We want all links to open in a new tab, window. Please support for us.  
My Confluence 6.0.0-OD-2016.12.2-1113.

Thanks so much,


author: Carlos Gomez
body: I use an HTML Link Macro to do this.

<http://www.brikit.com/display/documentation/HTML+Link+Macro>

comments: author: Shawn Connelly
body: Is this available for the cloud version of Confluence?

Which actual Brikit product contains the HTML link macro? It's difficult to tell from their website. Also, how much does it cost. I guessed it was in the Content Flow product but their pricing page is broken: <https://marketplace.atlassian.com/plugins/com.brikit.contentflow/server/pricing>

Thanks


author: Carlos Gomez
body: Not sure if it's available on the cloud version of Confluence.

Brikit Theme Press product contains the "HTML Link" and "OPEN LINKS (NEW WINDOW)" macros.

In the following link, scroll down to the bottom of the Brikit page to see all of the Macro examples that come with the Brikit Theme Press package. [http://www.brikit.com/display/themepressdemo/Macro+Examples](http://www.brikit.com/display/themepressdemo/Macro+Examples?)

For the pricing, sorry I don't have that information as I'm not an administrator.


author: Glen Lipka
body: **FOR HOSTED VERSION**

In the custom HTML, (end of HEAD) put

```
&lt;script&gt;AJS.toInit(function(){  $("a.external-link").attr("target","_blank");});&lt;/script&gt;
```

Also if you want bonus points...

```
&lt;style&gt;a.external-link {    background-image: url(http://bits.wikimedia.org/static-1.24wmf21/skins/Vector/images/external-link-ltr-icon.png);    background-repeat: no-repeat;    background-position: right center;    padding-right: 15px;  }  &lt;/style&gt;
```

That will make all external links open in a new tab.

comments: author: Davin Studer
body: The question is for OnDemand ... no custom html.


author: Glen Lipka
body: Hmm. Bummer. Well, it's the right answer for people with the hosted version.


author: SimratPal Singh
body: Haven't done that ever but can point to few directions.

1- Add links in html macro use href to create a link. Than either you can use browser settings to setup to open links in new windows.

2 - Can add java script in "Custom HTML" section of "General Configuration" to play around and open links in new windows.

comments: author: Davin Studer
body: This is for ondemand. Those are not available in ondemand.


author: Rita Kumar
body: I dont see that option in general config in the on demand version Simrat


author: SimratPal Singh
body: Ahh, I wasn't aware. I always have been working on server version. Isn't there a provision to add macros in on demand version?


author: SimratPal Singh
body: Browsers have an option to open hyper links in new windows if u want to try tht.


Tags: cloud

confluence-cloud

link-window