Re: redirection in a zpt
Philip Kilner <[email protected]> Fri, 08 Jul 2005 14:09:47 +0100
| Newsgroups | gmane.comp.web.zope.page-templates |
|---|---|
| Organization | XFR |
| Message-ID | <[email protected]> |
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