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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

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

User Defined Forms redirect hides content


Go to End


4 Posts   1312 Views

Avatar
kindleman.com.au

Community Member, 70 Posts

16 January 2014 at 2:08pm

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

Forum Moderator, 5523 Posts

16 January 2014 at 8:29pm

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
kindleman.com.au

Community Member, 70 Posts

17 January 2014 at 2:22pm

Awesome, thanks!

Avatar
jallen

Community Member, 1 Post

10 September 2014 at 11:18pm

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.