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?
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:
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>
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.