PerlPoint::Template::TT2 is a beta of a PerlPoint template processor for Template Toolkit 2 layouts.
METHODS
new()
Parameters:
class
The class name.
Returns: the new object.
Example:
# start page
$result.="nnnn";
# begin header
$result.="nnnn";
# header contents: this was added to the traditional list of template files
$result.=$me->_processTemplate(join('/', $tdir, $options->{$toc ? 'header_toc_template' : 'header_template'}), $toc ? 1 : $params{page});
# complete header
$result.="nnnn";
# begin body
$result.="nnnn";
# now the body contents: start with top part
$result.=$me->_processTemplate(join('/', $tdir, $options->{$toc ? 'top_toc_template' : 'top_template'}), $toc ? 1 : $params{page});
# add navigation, if necessary
$result.=$me->_processTemplate(join('/', $tdir, $options->{$toc ? 'nav_toc_template' : 'nav_template'}), $toc ? 1 : $params{page})
if exists $options->{$toc ? 'nav_toc_template' : 'nav_template'};
# include data (for TOCs, make sure not to add a standard TOC if the tree applet is used
# - this should be more generic in case users use other methods ...)
$result.=$toc ? $result=~/_toc() : $params{data};
# add bottom navigation, if necessary
$result.=$me->_processTemplate(join('/', $tdir, $options->{$toc ? 'nav_toc_template' : 'nav_template'}), $toc ? 1 : $params{page})
if exists $options->{$toc ? 'nav_toc_template' : 'nav_template'};
# finally, add the bottom part
$result.=$me->_processTemplate(join('/', $tdir, $options->{$toc ? 'bottom_toc_template' : 'bottom_template'}), $toc ? 1 : $params{page});
# close the body
$result.="nnnn";
# and complete the page
$result.="nnnn";
# build file name
my $filename=join('', "$options->{targetdir}/$options->{prefix}-", (fileparse($template, qr(.[^.]+)))[0], "-$params{page}$options->{suffix}");
warn "= PAGE SUPPLEMENT =====> $filenamen";
# write file
open(SUPPFILE, ">$filename") or die qq([Fatal] Could not open output file "$filename": $!.n);
print SUPPFILE $string;
close(SUPPFILE);
}
}
Requirements:
· Perl
Product's homepage
Requirements:
· Perl