To load this functionality from HTML:
<script>
CMS.loadExtra('cms-form', {...form configuration parameters...});
</script>
or from within config.js
extras: {
'cms-form': {...form configuration parameters...}
}
When running in server mode, the configuration can be pulled automatically from
the server-side configuration in config.php
.
{
"name-of-form": {
"fields": {
"field-name": { ...field-definition... },
...
},
},
}
Each field definition should be keyed with the field name and can contain the following fields:
label
- The label to display for the fieldtype
- The type of field (text, email, textarea)placeholder
- The placeholder text for the fieldrequired
- True/False Whether the field is requiredActions set from server configuration are only used on the backend and are not transmitted to the client.
N/A
<cms-form name="contact" success="pages/contact-thanks"></cms-form>
Will render the author's profile using the default layout template.
name
- The key name of the form to rendersuccess
- The page fragment to redirect to on successful submissionN/A