• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Open All Links (even internals) In New Tab

Open All Links (even internals) In New Tab 1.0.0

No permission to download
Compatible XF 1.x versions
1.0, 1.1, 1.2, 1.3, 1.4, 1.5
Hi,

Today I saw some where that some one needed such an add-on.

This is a simple template based add-on that will cause all links in your xenforo to be opened in new tab.
Both externals (that by default are opening in new tab) and internals (that by default are opening in the same tab)

If you just want to Force internal links in threads and posts to be opened in new tab, don't install the add-on (because it forces all links in all places in your site to be opened in new tab). Just Open "message" template of your style and add this code to first line:
Code:
<script>
window.onload = function() {
   if (!document.getElementsByTagName) return false;
   var links = document.getElementsByTagName("a");
   for (var i=0; i<links.length; i++) {
      if (links[i].getAttribute("class") == "internalLink") {
         links[i].onclick = function() {
            return !window.open(this.href);
         }
      }
   }
}
</script>
Hope to be useful.

Regards
Author
Dadparvar
Downloads
52
First release
Last update
Rating
5.00 star(s) 2 ratings

More resources from Dadparvar

Latest reviews

Should be standard component in Xenforo 1, but it isn't. Works great and keeps people at your website longer.
Dadparvar
Dadparvar
Thanks for your review :) it's good to see it was useful for you
This should be an option built in already, most prefer having something opened in a new tab while the old tab stays saved and not replaced with the new one.
Dadparvar
Dadparvar
Thanks for your review :) glad to see it was useful for you