[ZPT] page redirect

Tino Wildenhain tino@wildenhain.de
Mon, 26 Nov 2001 19:11:11 +0100


Hi,

--On Monday, November 26, 2001 10:09:56 +0100 Robert Rottermann=20
<robert@redcor.ch> wrote:

> I wonder whether this is the right way to do it. Since tal is evaluated
> before the page is displayed the page using such a redirect is never =
seen.

This is a common mistake, acutally RESPONSE.redirect() sets only the =
headers
(http status and location-header), but the page gets rendered normally.
If one dont want this effect, (s)he has to use
raise Redirect(url)

For this or the other method - this is logic and should not take
place in Templates anyway.

Regards
Tino

> Robert
> ----- Original Message -----
> From: "Geir B=E6kholt" <geirh@funcom.com>
> To: "Georges" <georges@madisoncomunicacao.com.br>
> Cc: <zpt@zope.org>
> Sent: Friday, November 23, 2001 7:28 PM
> Subject: Re: [ZPT] page redirect
>
>
>> Hello Georges,
>> Friday, November 23, 2001, 19:03:24, you wrote:
>> G>  how can I do a page redirect based in a condition using ZPT?
>>
>>
>> you should be able to do something like (untested):
>>
>> <span tal:condition=3D"here/checksomething"
>> tal:replace=3D"request.RESPONSE.redirect(URL)" />
>>
>> --
>> Geir B=E6kholt                       web-developer
>> geirh@funcom.com             funcom oslo | webdev-team
>>
>>
>> _______________________________________________
>> ZPT mailing list
>> ZPT@zope.org
>> http://lists.zope.org/mailman/listinfo/zpt
>>
>
>
> _______________________________________________
> ZPT mailing list
> ZPT@zope.org
> http://lists.zope.org/mailman/listinfo/zpt