How do I make my attachments open in a new window/tab?
You need to add a TARGET = "_blank" to the <a href> HTML tag.
The A element used in HTML denotes an anchor which is a hypertext link.
The HREF attribute specifies a hypertext link to another resource, such as an HTML document or a JPEG image.
The TARGET attribute is used with frames to specify the frame in which the link should be rendered. If no frame with such a name exists, the link is rendered in a new window unless overridden by the user. Special frame names begin with
an underscore. The frame used in this document is the _blank which renders the link in a new, unnamed window.
<Source: http://www.w3.org/TR/html401/struct/links.html >
For example, by using the HTML code below, clicking on the link "a new window" will open the "newwindow.html" page in a new window:
Open attachments listed for a Space
To open the attachments listed from the Browse Space->Attachments tab, in a new window, the ..\confluence\src\webapp\pages\listattachmentsforspace.vm file under your <Confluence-install> directory has to be modified. Below are the listed steps:
1. Locate the following block of code in the listattachmentsforspace.vm file:
2. In the line below:
add the parameter TARGET = "_blank" to the <a href> HTML tag, which will cause the URL specified in the href parameter to open in a new window or a new tag depending upon the option set in the browser. So the line above will be modified to:
Open attachments listed for a Page
To open the page attachments listed from the Page's Attachment(s) tab, in a new window, the ..\confluence\src\webapp\pages\viewattachments.vm file under your <Confluence-install> directory has to be modified. Below are the listed steps:
1. Locate the following block of code in the viewattachments.vm file:
2. In the line below:
add the parameter TARGET = "_blank" to the <a> HTML tag, which will cause the URL specified in the href parameter to open in a new window or a new tag depending upon the option set in the browser. So the line above will be modified to: