Alex Vandiver wrote:
> Use the redirect filter, inside a loop. The path you give to the
> redirect filter is relative to the output path.
[...]
> This _will_ leave you with an empty file from the template itself, but
> this is not usually a problem.
I often use my index page as the generator. For example:
products/index.html:
[% INCLUDE header
title = "Our Products"
%]
<ul>
[% FOREACH product IN products; # loop through each product
page = "${product.id}.html"; # construct product page URL
PROCESS product/page # generate product page...
FILTER redirect(page); # ...saving output to new file
%]
<li><a href="[% page %]">[% product.title %]</a></li>
[% END %]
</ul>
[% INCLUDE footer %]
This page builds an index with links to each product page. Each product
page is generated from the 'product/page' template and redirected to the
appropriate file. The index template serves as both the generator of
individual pages and also the index for the pages, thus killing two birds
with one stone.
A
_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates