When I insert a link anywhere in Confluence, the links always open in the same tab. We are using the Space sidebar links to store several assets about the project, like location of design files (Box.net), project canvas (mural.ly), etc..
Is there a way to make those links open in a new tab automatically?
Thanks!
You set the "target" property of the <a> tag to "_blank". You can do this with jQuery in your custom HTML header. However, if you only want certain links to open in a new tab, that will require you to identify those links (either by class or ID).
Here's an example where I have all "external" links open in a new tab:
<!-- Add target="_blank" to the URLs so that external links open in new browser page --> AJS.$("a[class='external-link']").attr('target','_blank');
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok... so no way to add a custom class, but I can see what the theme is defining and use it.
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Right click and view source or view element. Look at the code and see what it says. In your particular implementation, I don't know if there's a specific class that they use, but this is where I would start.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You would probably need to do something like this.
AJS.$('.plugin_pagetree_children_content a:contains("##Page Title Here##")').attr('target','_blank');
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.