Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Help getting links to open in new windows, please!

I know It’s been asked before (By others) but can someone please help me w/ getting links to open in a new window? I am using Vanilla on a WP Blog via Iframes and it (it being, all links opening in new windows) would make life much easier. Ideally I would like this to be the default for all users. Reading through the forums here, I realize that this is not an option that everyone likes or believes in but I feel it’s the best for me at this time. So any help would be appreciated. Oh, also I tried that link extension(which allows users to opt into opening links in new windows) but I won’t seem to work on my site and even if it did I am looking to make the change the default, not an opt in. Thanks in advance Avi.

Comments

  • I found this over here function outLnk() { if(!document.links) return; for (i = 0; i < document.links.length; i++) { var lnk = document.links[i]; if (lnk.href.match(/^(http|https)/) && (lnk.href.indexOf(location.hostname) == -1)) { lnk.setAttribute('target', '_blank'); }}} window.onload = function() { outLnk(); } Maybe that’s the solution but I don’t really know. If it is where would put this code and changes would I have to make for it work on my install? I am sure this do-able, I just need a little help.
  • I figured out how to solve the issue, so it can be considered resolved. Thanks
  • hey could you explain what you did? I am interested in doing the same thing!
This discussion has been closed.