MyBB Community Forums

Full Version: open all external site links in new tab (_blank)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How to do this?

I want all external site links to open in a new tab, but all links clicked that lead somewhere on my own site to stay within the current tab.

Regards
You can either request a plugin for this or if you are advanced with Javascript / jQuery you could add an event handler for the onclick event for "a" elements. Then use a regex or similar function on the href attribute.
no way I'm advanced enough to develop it.

its astounding there isn't already a solution / option / plugin for this, but have posted it in plugin request area. will see if it gets any love.
(2014-07-28, 02:44 PM)DrXotick Wrote: [ -> ]no way I'm advanced enough to develop it.

its astounding there isn't already a solution / option / plugin for this, but have posted it in plugin request area. will see if it gets any love.

to be fair I have never seen a use for a plugin all internal links are already handled by mybb and in most cases open in the same window (unless it's a popup) most external links are either within a post or added via html to a template.
external links coded by you in templates are an easy fix via the correct markup.

links within a post open in a new window/tab if you use the mycode
[url]...[/url]
tags unless I miss the point where else would you need to have alter the code to open with _blank ?