How can I insert a hyperlink and have it open a NEW page?
Asked by Kirk Swaney:

I am inserting hyperlinks into my definitions. I would like to have links inside of my definitions, so a user can have words inside of the definition defined for them if they're unsure.

The problem I am having is that when I insert a link in my definition, and I click on it, the link opens up in my current window. So in order to go back to my original definition, I have to use the back key.

I want to be able to insert a link, and have the link open a brand new page. Is this possible?

Thanks


Answers:
author: Daniel Borcherding
body: Hello,

Please have a quick read over the following two documents

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

<https://confluence.atlassian.com/display/CONFKB/How+to+Make+Confluence+Open+a+New+Tab+when+Clicking+on+the+Attachments+Link>

They should show you how to use a bit of JQuery to inject some properties into links of a given class. This will allow you to specify that all external links be open in a new tab.

comments: author: AM
body: THIS IS NOT AN ACCEPTABLE ANSWER!!! Completely unnaceptable that Atlassian after many years can't put in these very simple features. I have spent more time reading these jira support articles and looking at these ridiculous workarounds than it would have taken me to write the code myself. WHY? How hard is it to allow links to open in a new window? People have been asking for years! I agree with another user who said it is asinine. Makes no sense.

And Atlassian thinks that telling me to put custom jQuery on every page that needs it is a solution? What planet are you living on?

Serious mismanagement is happening here when simple requests like this get ignored for years. Or serious arrogance. Or both.


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

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


author: Adam Bennison
body: Atlassian never seem to answer anything, tumble-weed would be a better name for the company.


author: Gabrielle Gagnon
body: If your site has the HTML macro enabled, you can enter a link with a target in HTML code. For example:

{html}\<a href="https://confluence.atlassian.com/display/CONF43/Using+the+Editor" target="_blank"\> Edit a page\</a\>{html}

You can insert HTML code from the Editor either as Wiki Markup, using the syntax above, or by choosing Other Macros from the Insert menu and selecting the HTML macro from the list. (In that case just enter the HTML):

\<a href="https://confluence.atlassian.com/display/CONF43/Using+the+Editor" target="_blank"\> Edit a page\</a\>

The Confluence Editor (v. 4.3) inserts a line break before and after embedded HTML code, so if you want to include links in running text, you have to include the text as part of the HTML.

The other solutions offered so far are more elegant, but I'm not an admin, and my company doesn't allow third-party plugins, so this was the best workaround available to me.


author: CharlesH
body: I would recommend the Link Window macro, part of the Linking plugin from CustomWare. It works nicely, and the little icon next to the link (optional) tells the user the target will open in a new window.

<http://wiki.customware.net/repository/display/LINK/Linking+Plugin>

<http://wiki.customware.net/repository/display/LINK/link-window>

It's a free plugin by the way.


Tags: link