[Setup] Form prior redirection

Bastien Gauthier gbastien at commune.sambreville.be
Thu Mar 17 07:55:12 UTC 2011

You need to do this in the TAL of you PageTemplate, do not use actions and validation of the FormController...

So, customizing join_form and adding something like :

<html xmlns="http://www.w3.org/1999/xhtml"
      xml:lang="en" lang="en"
    <div metal:fill-slot="main">
      <tal:redirect define="dummy python: request.RESPONSE.redirect(portal.absolute_url() + '/my_join_form')" />

Should work ;-)

Note that you could do something simpler, I do the use-macro to have "portal" easily useable...

Have a nice day,

BASTIEN Gauthier
Service Informatique - Administration Communale de Sambreville

>-----Message d'origine-----
>De : setup-bounces at lists.plone.org 
>[mailto:setup-bounces at lists.plone.org] De la part de Denis Bitouzé
>Envoyé : jeudi 17 mars 2011 8:50
>À : setup at lists.plone.org
>Objet : [Setup] Form prior redirection
>in a Plone 3.1 site, I have created a form with PloneFormGen 
>and I'd like the user to be automatically redirected to its 
>URL (let say
>http://<my_site>/forms/my_join_form) when he visits the 
>http://<my_site>/join_form URL.
>I noticed that it is possible to customize the join_form Page 
>Template and to deal with some 'redirect_to' actions in the 
>'Actions' tab, but they are for redirections /after/ and not 
>/before/ submission of the corresponding form.
>Could you please let me know a trick for this purpose?
>Thanks in anticipation.
>Setup mailing list
>Setup at lists.plone.org

More information about the Setup mailing list