On Tue, 16 Sep 2003, Andy Wardley wrote:

>      [% 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 
>      %]

<snip/>

> 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.

Last time I looked at this, the approach doesn't work when you use the
pre_process ttree directive to add a wrapper around your pages. I
routinely have a template, page.tt which contains the [% WRAPPER %]
directive, saving me from having to put it in each actual page template 
but calling a page from within a page means that the wrapper never gets 
called.

Is there a better idiom that would work in both cases ?

Simon.

-- 
"You've really gotta know where your towel is."
 


_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to