Content last modified Monday 3 September 2018
hop to #bottom
Current version:
About It:
Get it:
Rate it:
  • Helpful?
  • 2 Yes
  • 0 No
Flag it:

If you'd like to provide updated information and do not have access to directly edit, please contact the site admin; thanks!


This plugin is a hack to get around the fact that Textpattern doesn’t have a native way to create links with a target=”_blank”. There has been a lot of talk about why it’s not XHTML this- or that-compatible, but, frankly my dear, ... who cares! If I want such a link because it makes my page more usable, I should be able to do it without fuss, and without client-side Javascript dependencies.

To use it, wrap the region where you want the behaviour in the plugin tag. In the region, all links that have the user-defined class will have target="_blank" added to them. The default class is "_", but you can override this using the tag’s class=”“ attribute.

Suggested usage: In the page(s), I wrap the insides of <body> with the tag and use textile link class to define links. Note the friendly link/class notation "(class)text":url doesn’t seem to be available until Txp 4.0.5.

Example 1 (Simple):

This would be an "(_)external link":


<p>This would be an <a href="" target="_blank" class="_">external link</a>.</p>

Note how the class tag remains in the output HTML.

Example 2 (custom class):

<txp:jra_ext_link class="bob" >
This is an "(bob)external link":


<p>This is an <a href="" target="_blank" class="bob">external link</a>.</p>

Article Request Count:
Initially released:
Posted here:
08 Oct 2007

You know you want to visit the Archives.
Published with Textpattern