Template::Plugin::LinkTarget - TT filter to add "target" attribute to all HTML links
[% USE LinkTarget(target="_blank" exclude=['www.example.com']) %] ... [% FILTER linktarget %] <a href="http://www.google.com/">Google</a> [% END %] ... [% text | linktarget %]
Template::Plugin::LinkTarget is a filter plugin for TT, which adds a target attribute to all HTML links found in the filtered text.
Template::Plugin::LinkTarget
target
Through the use of the exclude option, you can specify URLs that are not given a new target attribute. This can be used to set up a filter that leaves internal links alone but that sets up external links to open in a new browser window. exclude accepts a list of regular expressions, so you can be as elaborate as you'd like.
exclude
The target option specifies what target you'd like to give to links, defaulting to "_blank".
Initializes the template plugin.
Filters the given text, and adds the "target" attribute to links.
Graham TerMarsch (cpan@howlingfrog.com)
Copyright (C) 2008, Graham TerMarsch. All Rights Reserved.
This is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Template::Plugin::Filter.
To install Template::Plugin::LinkTarget, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Template::Plugin::LinkTarget
CPAN shell
perl -MCPAN -e shell install Template::Plugin::LinkTarget
For more information on module installation, please visit the detailed CPAN module installation guide.