• Icon: Suggestion Suggestion
    • Resolution: Duplicate
    • None
    • None
    • We collect Confluence feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      NOTE: This suggestion is for Confluence Server. Using Confluence Cloud? See the corresponding suggestion.

      This is particularly useful when you are linking to an external URL.

      Something like:
      alias

      I think OpenWiki does this:
      [alias

      I dunno which is easier to regex...

            [CONFSERVER-1986] Extend Link markup to open link in new browser/tab

            I guess this was kept open as it was specifically in reference to markup, but since 4.0 I think this can safely be called a duplicate of CONF-11194 so I'll close and link it up.

            John Masson added a comment - I guess this was kept open as it was specifically in reference to markup, but since 4.0 I think this can safely be called a duplicate of CONF-11194 so I'll close and link it up.

            Here is a Javascript implementation that will work regardless of Confluence internals:

            (function(){
            var hostname = window.location.hostname.replace("www.", "").toLowerCase();
            var i = document.links.length;
            while ( --i >= 0 ) {
            var thisLink = document.links[i];
            var thisHref = thisLink.href.toLowerCase();
            if ( (thisHref.indexOf("http://") != -1 || thisHref.indexOf("https://") != -1)
            && thisHref.indexOf(hostname) == -1 ) {
            thisLink.target = '_blank';
            thisLink.className = 'external';
            }
            }
            })();
            

            Robert Collier added a comment - Here is a Javascript implementation that will work regardless of Confluence internals: (function(){ var hostname = window.location.hostname.replace( "www." , "").toLowerCase(); var i = document.links.length; while ( --i >= 0 ) { var thisLink = document.links[i]; var thisHref = thisLink.href.toLowerCase(); if ( (thisHref.indexOf( "http: //" ) != -1 || thisHref.indexOf( "https://" ) != -1) && thisHref.indexOf(hostname) == -1 ) { thisLink.target = '_blank' ; thisLink.className = 'external' ; } } })();

            Hi Richard,

            I have implemented the script for external links in our Confluence 3.2.0 and it works a treat. Opens a new tab in FF3.5 and IE7. Haven't tested other browsers.
            I can only hope it doesn't get fubared by a future Confluence upgrade where they change the link handler syntax ... Been bitten by syntax changes before, hehe

            Diane Sexton added a comment - Hi Richard, I have implemented the script for external links in our Confluence 3.2.0 and it works a treat. Opens a new tab in FF3.5 and IE7. Haven't tested other browsers. I can only hope it doesn't get fubared by a future Confluence upgrade where they change the link handler syntax ... Been bitten by syntax changes before, hehe

            Richard added a comment -

            Seems this can be done now: http://confluence.atlassian.com/display/DOC/How+to+Force+Links+to+Open+in+a+New+Window

            Has anyone implemented this?

            Richard added a comment - Seems this can be done now: http://confluence.atlassian.com/display/DOC/How+to+Force+Links+to+Open+in+a+New+Window Has anyone implemented this?

            Richard added a comment -

            Agree with Matts comments; and an icon to differentiate would be ideal

            Richard added a comment - Agree with Matts comments; and an icon to differentiate would be ideal

            Tallulah added a comment -

            Any updates on this? I completely agree with Matt's last comment, and I think there's a large number of people out there who would really like this feature.

            Tallulah added a comment - Any updates on this? I completely agree with Matt's last comment, and I think there's a large number of people out there who would really like this feature.

            Matt Watts added a comment -

            I don't see why there couldn't be a checkbox preference that "enables" remote links opening in a new window. It could be off by default to assuage Mike's preference of not interfering with the UI, but then could be enabled by space or site administrators that want the option. Then all links that don't point to confluence could open in a new window. Perhaps they could also be giving a icon similar to wikipedia that denotes its external.

            Matt Watts added a comment - I don't see why there couldn't be a checkbox preference that "enables" remote links opening in a new window. It could be off by default to assuage Mike's preference of not interfering with the UI, but then could be enabled by space or site administrators that want the option. Then all links that don't point to confluence could open in a new window. Perhaps they could also be giving a icon similar to wikipedia that denotes its external.

            Ben Vaughn added a comment -

            Agree this would be useful – Mike: some environments have extremely computer inarticulate users (mine included) and being able to structure the environment just so is preferable because it makes remote support a lot easier.

            Ben Vaughn added a comment - Agree this would be useful – Mike: some environments have extremely computer inarticulate users (mine included) and being able to structure the environment just so is preferable because it makes remote support a lot easier.

            Ken Roland added a comment -

            I will add the user macro as stated above. But we are asked many times for a new window link. Mostly when the link goes to an external site and the confluence page includes instructions on what to do when they get there. First they click the link, the new page loads, they try to remember what to do, click a few links, get ALMOST to where they need to be then forget a step. Now they have to use back, back, back, (The reason I believe why the Back button is so used according to useit.com), CTRL-Click the link to open a new tab, and then click through back to where they were. Then of course they send me an email complaining that the link should've automatically opened a new tab since I knew that everyone would need both pages open at the same time.

            (Coincidentally I find the "Notation Guide" in Confluence the most annoying pop-up window since it opens on a completely different monitor on my machine! It should open in a div somewhere right on the page ... but that's another story)

            Ken Roland added a comment - I will add the user macro as stated above. But we are asked many times for a new window link. Mostly when the link goes to an external site and the confluence page includes instructions on what to do when they get there. First they click the link, the new page loads, they try to remember what to do, click a few links, get ALMOST to where they need to be then forget a step. Now they have to use back, back, back, (The reason I believe why the Back button is so used according to useit.com), CTRL-Click the link to open a new tab, and then click through back to where they were. Then of course they send me an email complaining that the link should've automatically opened a new tab since I knew that everyone would need both pages open at the same time. (Coincidentally I find the "Notation Guide" in Confluence the most annoying pop-up window since it opens on a completely different monitor on my machine! It should open in a div somewhere right on the page ... but that's another story)

            Whether a link opens in a new tab or window is an attribute of the link in many web-based tools, including many that are free or extremely cheap. It must be pretty easy to program. This is, let us say, conspicuously absent from Confluence and the lack of it gets noticed. I strongly urge its inclusion in the next release.

            Peter Dorfman added a comment - Whether a link opens in a new tab or window is an attribute of the link in many web-based tools, including many that are free or extremely cheap. It must be pretty easy to program. This is, let us say, conspicuously absent from Confluence and the lack of it gets noticed. I strongly urge its inclusion in the next release.

              jmasson@atlassian.com John Masson
              3b1ae0ec93c9 Nick Minutello
              Votes:
              26 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: