Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I insert a link that automatically opens a second tab?

Paige Funk
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 27, 2018

I am creating links to PDF files.  Currently, when a user clicks on the link, it navigates from the Confluence page to the PDF.  I would prefer the PDF opened in a new tab by default.  Is this possible?

1 answer

0 votes
Igor M.
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 28, 2018

Hello,

If those links are to pdf files stored somewhere else, you can follow How to force links to open in a new window KB:

  1. Visit Administration >> Custom HTML
  2. Click Edit
  3. In the At end of the HEAD field, insert this code:
    • For external links only, like [http://www.google.com]:

      <script>
      jQuery(document).ready(function() {
          jQuery(".external-link").attr("target", "_blank");
      });
      </script>
    • For all type of links (internal and external):

      <script>
      jQuery(document).ready(function() {
          jQuery(".wiki-content a").attr("target", "_blank");
      });
      </script>
  4. Hit Save

If you want Attachments to open in a new tab, and you are using Confluence Server, then How do I make my attachments open in a new window or tab? the guide should help. You would need to make some customisations for that. Let me know if you have any questions.

Regards,

Igor

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events