• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.5 Looking for a way to open post links in new tab

[xFv]

Previously Cylent1
#1
As the title suggests, I am looking for a way to open ONLY links inside of posts in a new tab.
Is there a way this can be done?
Thank You!
 

wang

Well-known member
#2
As the title suggests, I am looking for a way to open ONLY links inside of posts in a new tab.
Is there a way this can be done?
Thank You!
The external links already open in a new windows. To do that with internal links too, an add on or custom developement is needed.

If you are not opposed to editing files, find this bit of code it at the String.php file in the Helpers folder.

PHP:
if ($isInternal)
            {
                $target = '';
                $class = 'internalLink';
                $type = 'internal';
            }
And change it to:

PHP:
if ($isInternal)
            {
                $target = '_blank';
                $class = 'internalLink';
                $type = 'internal';
            }