How to allow target="_blank" in News Articles

When posting a news article in admin using TinyMCE, if you want to post a link to a webpage, and have that web page open in a new browser window or browser tab, you would normally use the target="_blank" attribute in the link.  Something like this:


<a title="New Window" href="http://www.youtube.com/watch?v=yKWWyEP7Xaw" target="_blank">YouTube Video</a>

The trouble with this, is that HTML Purifier is configured to strip the target attribute when you save the post, and the link will open in the same browser window. 

To allow the target attribute:

In the file: inc/utils.inc.php

Find: $oConfig->set('Filter.YouTube', true);

Directly below that, on a new line, add: $oConfig->set('Attr.AllowedFrameTargets', array('_blank'));

Save File.  The target="_blank" attribute will not be stripped when posts are saved

EDIT: August 5, 2010

This post does NOT apply to the current version of Dolphin.  The current utils.inc.php modifies HTML Purifier so that the target attribute is no longer stripped.

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 19 Jan 2010

So the attribute

Find: $oConfig->set('Filter.YouTube', true); 

is going to look at the domain that it is linking to, and allow/disallow a link to open a new window?  I have added a business directory that I will also be populating with Affiliate links from sites like Commission Junction. So adding in the domains that they encode their links with will be allowed as long as I put them into the inc/utils.inc.php?

Even Monkeys and Retards get it right with repitition! - Author Unknown
Quote · 5 Aug 2010

So the attribute

Find: $oConfig->set('Filter.YouTube', true); 

is going to look at the domain that it is linking to, and allow/disallow a link to open a new window?  I have added a business directory that I will also be populating with Affiliate links from sites like Commission Junction. So adding in the domains that they encode their links with will be allowed as long as I put them into the inc/utils.inc.php?

Ummmm.... No.

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 5 Aug 2010
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.