Re: [ZPT] redirection in a zpt

2005-07-08 Thread Dieter Maurer
Kenneth Gonsalves wrote at 2005-7-8 18:16 +0530:
>in a zpt, i use tal:condition to check something. If it is true, the 
>browser should redirect to another template. How do it do this?

 

Note, however, that (this form of) redirect takes effect only at the end of
the request. You must take care, that further request
processing does not do bad things...

-- 
Dieter
___
ZPT mailing list
ZPT@zope.org
http://mail.zope.org/mailman/listinfo/zpt


Re: [ZPT] redirection in a zpt

2005-07-08 Thread Philip Kilner
Hi,

Kenneth Gonsalves wrote:
> in a zpt, i use tal:condition to check something. If it is true, the 
> browser should redirect to another template. How do it do this? In 
> python cgi i was doing:
> 
> print "Location:" "url_to_go_to/n/n"
> 
> any clues?
> 

- Define each template (for your set of conditions) as a macro.

- In your page, use tal:condition to call the appropriate macro for the
conditions.

You'll find tal:condition-ally calling macros easier to follow than a
redirect. If you must use a redirect, I'd implement the redirect in a
script and conditionally call the templates form the script...


-- 

Regards,

PhilK

Email: [EMAIL PROTECTED]
PGP Public key: http://www.xfr.co.uk
Voicemail & Facsimile: 07092 070518

"You'll find that one part's sweet and one part's tart:
say where the sweetness and the sourness start."
- Tony Harrison
___
ZPT mailing list
ZPT@zope.org
http://mail.zope.org/mailman/listinfo/zpt