[ZPT] Page Template Preconditions?

Evan Simpson evan@4-am.com
Mon, 12 Aug 2002 13:36:55 -0500


jeffrey wrote:
> I lied.  "raise 'redirect', ..." from a Python script called in a
> tal:define statement becomes a TALESError.  If that same Python scrip calls
> RESPONSE.redirect, it usually works.

It's case sensitive -- use 'Redirect' :-/

> I think I got squeamish about when using a page-wide macro in the <html>
> tag itself, where such a define call should be put.  I was under deadline
> and didn't spend enough time investigating the behaviors of metal:use-macro
> in the same tag with a tal:define (I was worried that the tal:define would
> get eaten by the Macro).

It does.  You end up putting a <tal:block define="global ..." /> or 
somesuch above the <html>, which is eucchy ;-)  This *might* be a job 
for the long-proposed but never-implemented processing instructions, as in:

<?tal before-publish="container/setup"?>
<?metal use-macro="here/standard_template.pt/macros/page"?>
<html>...</html>

> It's not a critical need, but I think it would be a nicety.

It's at least worth talking about.

Cheers,

Evan @ 4-am