[ZPT] page redirect

Georges georges@madisoncomunicacao.com.br
Mon, 26 Nov 2001 14:53:43 -0200


Hi,

how can I "raise Redirect(url)"?

()s,
Georges

----- Original Message -----
From: "Tino Wildenhain" <tino@wildenhain.de>
To: "Robert Rottermann" <robert@redcor.ch>; "Geir Bækholt"
<geirh@funcom.com>; "Georges" <georges@madisoncomunicacao.com.br>
Cc: <zpt@zope.org>
Sent: Monday, November 26, 2001 4:11 PM
Subject: Re: [ZPT] page redirect


Hi,

--On Monday, November 26, 2001 10:09:56 +0100 Robert Rottermann
<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ækholt" <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="here/checksomething"
>> tal:replace="request.RESPONSE.redirect(URL)" />
>>
>> --
>> Geir Bækholt                       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