The following plugin modules are distributed with the Template Toolkit.
The Format plugin provides a simple way to format text according to a printf()-like format.
[% USE bold = format('<b>%s</b>') %] [% bold('Hello') %]
The URL plugin provides a simple way of contructing URLs from a base part and a variable set of parameters. See Template::Plugin::URL for further details.
[% USE mycgi = url('/cgi-bin/bar.pl', debug=1) %] [% mycgi %] # ==> /cgi/bin/bar.pl?debug=1 [% mycgi(mode='submit') %] # ==> /cgi/bin/bar.pl?mode=submit&debug=1
The Table plugin allows you to format a list of data items into a virtual table by specifying a fixed number of rows or columns, with an optional overlap. See Template::Plugin::Table for further details.
[% USE table(list, rows=10, , overlap=1) %] [% FOREACH item = table.col(3) %] [% item %] [% END %]
The CGI plugin is a wrapper around Lincoln Stein's <lstein@genome.wi.mit.edu> CGI.pm module. The plugin is distributed with the Template Toolkit (see Template::Plugin::CGI) and the CGI module itself is distributed with recent versions Perl, or is available from CPAN.
The XML::DOM plugin gives access to the XML Document Object Module via Clark Cooper <cooper@sch.ge.com> and Enno Derksen's <enno@att.com> XML::DOM module. The plugin is distributed with the Template Toolkit (see Template::Plugin::XML::DOM) and requires the XML::DOM module, available from CPAN:
http://www.cpan.org/modules/by-module/XML
The XML::RSS plugin is a simple interface to Jonathan Eisenzopf's <eisen@pobox.com> XML::RSS module. An RSS (Rich Site Summary) file is typically used to store short news 'headlines' describing different links within a site. This plugin allows you to parse RSS files and format the contents accordingly using templates. The plugin is distributed with the Template Toolkit (see Template::Plugin::XML::RSS) and requires the XML::RSS module, also available from CPAN:
The following module is distributed separately from the Template Toolkit.
Simon Matthews <sam@knowledgepool.com> has developed a DBI plugin for the Template Toolkit which brings the full power of Tim Bunce's <Tim.Bunce@ig.co.uk> database interface module (DBI) to your templates. The DBI plugin and the DBI modules themselves are available from CPAN at:
http://www.cpan.org/authors/id/S/SA/SAM/ http://www.cpan.org/modules/by-module/DBI/
To install Template, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Template
CPAN shell
perl -MCPAN -e shell install Template
For more information on module installation, please visit the detailed CPAN module installation guide.