[ZPT] Recursive ZPT?

Steve Spicklemire steve@spvi.com
Wed, 21 Nov 2001 21:09:42 -0500


Thanks Dieter,

Dieter Maurer wrote:
> Macros are definitely not good to build recursion.
> 
>    When you read the "metal" documentation carefully you will find
>    that metal attribute processing is independent of any "tal" attributes.
>    This implies: you cannot control macro expansion with "tal:condition".
> 
> You should be able to recursively call a template:
> 
>     <XXX tal:replace="structure python:template(level= level-1)" />
> 
> The "level" parameter will be available inside the called ZPT as
> a key in the "options" variable (a dict).
> 

Ahh.. I somehow got it in my head that page templates had to start with
<html> and form a "complete" page, but I see now that it's not true. So
a "Dreamweaver" wouldn't be able to edit such a template, but maybe
that's OK.

thanks!
-steve

> Dieter