Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to open pages in a new window?

David Stein July 22, 2016

Is there a way so my links open pages in a new window or tab? 

3 answers

1 accepted

1 vote
Answer accepted
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.
July 22, 2016

Hi,

We do this on our instance but only with links leading to external sites. Just copy and paste the code below into the "At end of the BODY" Custom HTML section in the admin area.  I gave two examples depending on what you you want to do. 

<script>

AJS.toInit(function() {

AJS.$("a").attr("target", "_blank"); <-- if you want all links to open in a separate tab

AJS.$(".external-link").attr("target", "_blank");  <-- if you only want links to external sites to open in a separate tab

});

</script>

Debra Hicks May 10, 2017

Then 1st one works great to open links to other Wiki Pages and the 2nd worked for external sites. Thanks!

I would be really greatful if you could come up with one to open links to attachments on a new tab :)

1 vote
TomC
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 22, 2016

To piggyback on what Alex said, see Atlassian's Confluence documentation on How to Force Links to Open in a New Window.  

You also may want to consider voting on the feature request mentioned on that page to add this as a native feature: https://jira.atlassian.com/browse/CONF-11194

 

Meanwhile, some Confluence plugins offer this functionality via built-in macros. For example, Brikit's Theme Press (disclosure: we are a Brikit customer which is why I know this) offers a Open Links in New Window macro (one of many included macros in that plugin - see the full list).

David Stein July 22, 2016

Thank you for the info~ I voted, and saw Adam's message from April, so it looks as though they are still working on it?

TomC
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 22, 2016

David, Yep, that appears to be the case as it is marked as 'In Progress' but it appears to be on the way. That's a good thing!

0 votes
Debra Hicks May 23, 2017

I found another way to do it since my company won't add even a free plug-in.

This one looks great:   https://confluence.atlassian.com/spacedirectory/view.action

***

Edit the space stylesheet:

Space Admin > Stylesheet

add the following: 

a {
target-name:new;
target-new:tab;
}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events