This module gives you basic control over URL target attributes for text filters. The Target URL Filter Module is a simple light weight module based on the core filter_url function to add a URL filter with one of a selection of standard HTML target attributes.

There are more complex modules providing the ability to customize a variety of filters. These don't seem to control link attributes, however. There are also projects like External Links (https://drupal.org/project/extlink) that use JS to add indications to links if they are outside of the current domain. Target Filter URL is much simpler. Plus its functionality is derived through php, so there is no need to worry about javascript errors with infinite scrolls and ajax elements.

If you merely want the ability to control where links created by input filters will open, then this project is what you need. Say you want links that your users include in a text field to open in a _blank tab. This makes that happen. It does not differentiate between domestic URLs within the current domain and links to outside of the domain. Perhaps that is a feature that could be added in the future, but for now this fulfills a basic function providing more control over URLs.

A possible use case: Users can add links in their content that will be displayed through an infinite scroll view on your site. After the user content is submitted, you want users to be able to click the links when looking at the view, but you don't want them to loose their place or to navigate away from your site when the link opens in the same window as the view. You can use this module so that any link will open in a new '_blank' window/tab (depending on browser settings) and keep your view page untouched.

In addition to '_blank', you could also set the <a> object target attribute to _parent, _self or _top.

Target URL Filter was originally adapted by J. Branson Skinner for https://theor.org.

Requirements
------------
PHP 5.3 or greater -The functionality is derived through the PHP use keyword only supported in PHP 5.3 or greater.
Filter - Needless to say, You need to have the core filter module installed.
https://api.drupal.org/api/drupal/modules!filter!filter.module/7

Installation
------------
Follow the normal procedure to place the module folder and files in sites/all/modules and then enable through drush or the user interface.

Configuration
------------
With this filter enabled on a text format you should disable the core URL Filter for that format so as to avoid conflict. For more on configuring text formats: https://drupal.org/node/778976

Future and Maintenance
------------
In the future this project may grow or morph to allow for additional url attributes, but for now this is pretty simple and will be maintained simply as well -- since there isn't much that can break.

Supporting organizations: 
Sponsoring organization

Project information

Releases