TYPO3.Form:Form - finishers "Confirmation" redirect to success page

Is there any way to change the ‘TYPO3.Form:Confirmation’ behavior from displaying simple Text? I just want to redirect to a success page. so its editable from backend and localizeable.

i’m using this solution for building own formulars:

http://www.typo3.net/forum/thematik/zeige/thema/118610/

contact-form.yaml:

type: 'TYPO3.Form:Form’
identifier: contact-form
label: 'Contact form’
renderingOptions:
submitButtonLabel: 'Send’
templatePathPattern: 'resource://Neos.BasePage/Private/Templates/ContactForm/Form.html’
renderables:

type: 'TYPO3.Form:Page'
identifier: page-one
label: 'Contact'
renderables:
  -
    type: 'TYPO3.Form:SingleLineText'
    identifier: name
    validators:
      - identifier: 'TYPO3.Flow:NotEmpty'
  -
    type: 'TYPO3.Form:SingleLineText'
    identifier: email
    validators:
      - identifier: 'TYPO3.Flow:NotEmpty'
      - identifier: 'TYPO3.Flow:EmailAddress'
  -
    type: 'TYPO3.Form:MultiLineText'
    identifier: message
    validators:
      - identifier: 'TYPO3.Flow:NotEmpty'

[…]
finishers:

identifier: 'TYPO3.Form:Email'

[…]

identifier: 'TYPO3.Form:Confirmation'
options:
  message: >
    <h3>Thank you for your feedback!</h3>
    <p>Your email would have been sent.</p>

Hey Christian,

it seems not possible to do that ATM. There is a redirect finisher, that currently only redirects to a defined controller/action. While checking that, I created a pull request to allow to specify an URL to redirect to:

Just test it, if it fits your needs.

Cheers,
Daniel

Hey Daniel,

great, thats what i need.

Thanks!

Maybe i’m wrong but if i use your code it is not redirecting after submit the form. Is there Missing something like:

$formRuntime->setResponse($mainResponse->getContent());

at the end of executeInternal()? Or maybe i have to update the whole neos package?

The Header(‘Location: …’) was not shown. If i use “echo $mainResponse->getContent()” it redirects correctly.

Thanks for help!

Is it possible to redirect to the chosen language? Maybe it is also usefull to define just the node-identifier target or path segment or something like this. so the correct language can be selected be the redirect finisher automatically.

I dont want to show the english site in different language.

Mhm - should have tested it :smile:
I now have - and it works (but the solution needs to be discussed).
Please test again - and feel free to comment the PR at github

Sounds very interesting. But this cannot be done in the redirect finisher of the form framework, as the form framework only depends on flow and should not depend on neos / CR logic. So this means you have to build your own finisher (which is easily doable) and put it in an own package which depends on Neos / CR and form.

In this case, It would be also cool to put the target to the form nodeTyoe so you can select the target page in the inspector and use that reference in the finisher.

Simple redirect to success page (for other seekers):

type: 'Neos.Form:Form'
identifier: contact-form
label: Contact
renderingOptions:
    submitButtonLabel: send
renderables:
  -
    #define all desired renderables
finishers:
  -
    identifier: 'Neos.Form:Redirect'
    options:
      #will redirect to http://website.com/contact/thanks.html
      uri: 'contact/thanks.html'

Related Neos-Code: Neos/Form/Classes/Finishers/RedirectFinisher