Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

All other Modules

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

User Defined Forms redirect hides content


Reply

4 Posts   309 Views

Avatar
kindlemanwill

16 January 2014 at 2:08pm Community Member, 68 Posts

Hi, I have set up a contact form using UserDefinedForms module. All works as expected.

Is there a way to not replace the $Content when a user defined form submits? Ideally, a flash message would be configurable rather than replacing the page content.

Thanks

W

Avatar
Willr

16 January 2014 at 8:29pm Forum Moderator, 5511 Posts

https://github.com/silverstripe/silverstripe-userforms/blob/master/code/model/UserDefinedForm.php#L1080

Add a custom ReceivedFormSubmission.ss to your theme and enter whatever variables such as $Content in there.

Avatar
kindlemanwill

17 January 2014 at 2:22pm Community Member, 68 Posts

Awesome, thanks!

Avatar
jallen

10 September 2014 at 11:18pm Community Member, 1 Post

Thanks for your information. I'm in struggling that the finished message showed blank. It seems the finished page still rendered with my UserDefinedForm.ss instead of ReceivedFormSubmission.ss. One of my trial is to add "render" at the end of finished() like below:

return $this->customise(array(
         'Content' => $this->customise(array(
            'Submission' => $submission,
            'Link' => $referrer
         ))->renderWith('ReceivedFormSubmission'),
         'Form' => '',
      ))->renderWith(array('ReceivedFormSubmission','Page'));

it can make the page rendered with ReceivedFormSubmission.ss but still shows nothing, I'm thinking the value of $OnCompleteMessage in ReceivedFormSubmission.ss is correctly got.

Would be thankful if any suggestion provided.