-
Notifications
You must be signed in to change notification settings - Fork 4
Add Forms
iJungleboy edited this page Jan 24, 2017
·
2 revisions
Since the setup is generic, you can do anything you want. The basic setup allows you to easily add more custom forms.
Note that you only need to do this, if you want multiple different forms in this app. If you only want to customize the one form and/or re-use the same form again, this is not for you.
Note that you should also read the Overview as it helps you understand why certain steps are recommended.
The default pattern assumes you'll work with the standard Save-WebApi or with your own WebApi, which expects the same configuration as the standard setup does.
- Create another content-type with the fields you want to store.
- In here, create all the fields you want to store
- We recommand that you also add fields for
-
Timestamp
(date) -
SenderIP
(string) -
ModuleId
(number)
-
- You can also create a
Title
field which would be auto-filled with "Form 2017-xx-xx" (the current date/time) - You can also create a
RawData
field (type: Custom) into which the save-script would just put the raw JSON of all submissions - great for debugging
- Optionally - but often not needed: create custom mail templates
- Optionally - but often not needed: create custom save-WebAPI
- Now, create a
SubmitType
content-item which configures that the WebApi (the default or yours) should create the expected Content-Type (the new one you just made) and should use the e-mail templates you specified. Often you'll just copy an existing SubmitType-item and change just the Content-Type. - Create a new form file - best to copy the existing
_Contact Form.cshtml
and then modify it as needed.
That's all you need to do. If you want to customize even more, you can always change anything you want - even the JS or the WebApi.