1 Configuration
In order to use the feature, it must be activated in the configuration:
feature: forms: true
Each form is based on a form type, which must also be configured. For each of these types, a list of available form fields and their properties must be created.
1.1 General configuration
| Field | Type | Required | Description |
|---|---|---|---|
| nameI18n | translation map | required | Human-readable name of the form type, keyed by language code. |
| pluginName | string | required | Name of the Gentics Mesh plugin that handles submissions for this form type. |
| descriptionI18n | translation map | optional | Optional description of the form type, keyed by language code. |
| submitOnce | boolean | optional | If true, the form can only be submitted once per user. Intended for polls and surveys. |
| external | boolean | optional | If true, the form is treated as an external form and not a Gentics Mesh Forms Plugin form. |
| controls | map of control configs | required | Defines all available input controls for this form type. The map key is the control ID used to reference the control in form definitions. See controls table below. |
| blocks | map of block configs | optional | Defines all available layout and structural blocks for this form type. The map key is the block ID. See blocks table below. |
| captchaOptions | list of select options | optional | Defines which captcha types are available for this form type. Each option has a value key and a labelI18n translation map. |
| templateOptions | list of select options | optional | Defines available styling variations (themes) for the form type. Each option has a value key and a labelI18n translation map. |
| userEmailTemplateOptions | list of select options | optional | Defines which email templates are available for the confirmation email sent to the user upon form submission. |
| adminEmailTemplateOptions | list of select options | optional | Defines which email templates are available for the notification email sent to the administrator when a user submits the form. |
| flows | list of flow configs | optional | Defines the available form flows for this type. A flow controls the sequence of screens (e.g. form, summary, success) presented to the user. The first entry is used as the default. Each flow has an id, labelI18n, nameTranslationKey, and a list of steps. Each step defines a reactClass (the screen component), navigation buttons, and optional variables passed to the component. See the Form flows section below. |
| pluginConfiguration | object | optional | Arbitrary configuration object passed to the Mesh plugin to configure type-specific behaviour. Structure depends on the plugin. |
1.2 Internal and external forms
Forms come in two kinds, internal and external, which are handled differently. Which kind a form is, is determined by its form type and configured per form type via the external flag (in combination with pluginName) in the General configuration above.
| Kind | Configuration | Handled by |
|---|---|---|
| Internal form | external: false (the default when the flag is omitted) | A Gentics Mesh plugin, named by pluginName (e.g. the Gentics Mesh Forms Plugin for pluginName: "forms"), which processes and stores the submissions. |
| External form | external: true | Treated as an external form and not by the Gentics Mesh Forms Plugin. |
Internal forms are the forms managed by this feature: they are created and edited in the Editor and their submissions are processed by the configured Mesh plugin. This is the default, and all examples in this document are internal form types.
The external flag is a property of the form type, not of an individual form. All forms created from a form type therefore share the same kind.
1.3 Available control types
| Control | Setting types used | Aggregate | Description |
|---|---|---|---|
| string | translation, string, number, select | no | Single-line text input. Supports a placeholder (label), default value, maximum character length, and an optional regex-based validator. |
| number | translation, string, number | no | Integer/numeric input. Supports a placeholder (label), default value, and minimum and maximum value constraints. |
| datetime | translation, string | no | Date input in yyyy-MM-dd format. Supports a placeholder (label) and default value. |
| time | translation, string | no | Time input in HH:MM format. Supports a placeholder (label) and default value. |
| boolean | string, boolean | no | Checkbox control. Configures the value stored when checked and the default checked state. |
| catalog | options, boolean | no | Selection control (dropdown or radio buttons). Editors define the available options as key-value pairs. An additional free-text option can optionally be enabled. |
| binary | translation, number, boolean, select | no | File upload control. maximum file size in MB, whether multiple uploads are allowed, and a filter for allowed file types (images, videos, documents). |
| usermail | translation, number, select | no | Email address input for the form submitter. When filled out, a confirmation email is sent to the entered address. Configures placeholder, maximum length, email subject, and email template. |
1.4 Available block types
| Block | Setting types used | Container | Description |
|---|---|---|---|
| spacer | — | no | Adds visual spacing between form elements. No configurable settings. |
| conditionalcontainer | — | yes | A container whose contents are only shown when the configured control has a specific value. |
| sectionheadline | translation | no | A headline element for grouping form sections visually. The text setting supports rich content. |
| text | translation | no | A free text block for displaying explanatory text between form fields. The text setting supports rich content. |
| group | — | yes | A generic container for grouping related form elements. |
All setting types share the following common properties: id (required), labelI18n (required), descriptionI18n (optional), required (optional, defaults to false), backend (optional, only valid on control settings — if true the setting is not forwarded to the form renderer), propertyPath (optional, maps the value to a property path in the backend data model).
1.5 Control and block settings
| Type | Value | Type-specific properties | Description |
|---|---|---|---|
| string | string | richContent (boolean, optional), multiline (boolean, optional), multiple (boolean, optional) | A text input. richContent enables rich text editing, multiline renders a textarea, multiple allows entering more than one value. |
| translation | translation map | richContent (boolean, optional), multiline (boolean, optional) | A text input that can be filled per language. Supports the same richContent and multiline flags as string. |
| number | number (float) | — | Accepts any numeric value including decimals. |
| integer | number (integer) | — | Accepts whole numbers only. |
| boolean | boolean | — | A checkbox that yields true or false. |
| date | ISO date string | allowTime (boolean, optional) | A date picker. Set allowTime: true to also allow time selection. |
| select | string (one of options) | options (list, required), multiple (boolean, optional) | A dropdown with a fixed list of options defined in the configuration. Set multiple: true to allow selecting more than one value. |
| options | list of key-value pairs | multiple (boolean or "editable", optional) | Lets the form editor define the selectable options at authoring time. Set multiple: true for multi-select, false for single-select, or "editable" to let the editor decide. |
| reference | CMS object reference | referenceTypes (list, required), publishAs (required: content, url, or meshlink), multiple (boolean, optional) | A picker for referencing CMS objects (pages, files, or images). |
1.6 Configurable Element Settings
This section describes what can be configured per element as defined in the formtype configuration (forms.yml).
1.6.1 Controls
1.6.1.1 number – Number Input Field
| Setting | type | backend | propertyPath | Description |
|---|---|---|---|---|
| defaultValue | string | true | — | Default value |
| minValue | number | true | validation.minValue | Minimum value for number inputs |
| maxValue | number | true | validation.maxValue | Maximum value for number inputs |
1.6.1.2 string – String Input Field
| Setting | type | backend | propertyPath | Description |
|---|---|---|---|---|
| defaultValue | string | true | — | Default value |
| maxLength | number | true | validation.maxLength | Maximum number of allowed characters |
| validation | select | true | validation.regexValidation | Validators based on regular expressions with error messages |
| numberOfLines | number | false | — | Number of lines (renders the input as a multiline text field) |
1.6.1.3 datetime – Datetime Input Field
| Setting | type | backend | propertyPath | Description |
|---|---|---|---|---|
| defaultValue | string | true | — | Default value |
| dateOnly | boolean | true | dateOnly | Only a date (without time component) can be selected |
1.6.1.4 time
Same as datetime but without the dateOnly setting:
| Setting | type | backend | Description |
|---|---|---|---|
| defaultValue | string | true | Default value |
1.6.1.5 boolean – Checkbox
| Setting | type | backend | Description |
|---|---|---|---|
| storedValue | string | false | Value that is selected by this checkbox |
| defaultValue | boolean | true | This checkbox is checked by default |
1.6.1.6 catalog – Select
| Setting | type | backend | propertyPath | Description |
|---|---|---|---|---|
| selectOptions | options | true | — | List of selectable key/value pairs |
| customOption | boolean | false | — | Allows entering an additional selection option |
| isList | boolean | true | isList | Multiselection (allows selecting multiple options) |
| radio | boolean | false | — | Render as radio buttons (single value) or checkboxes (multivalue) |
1.6.1.7 binary – File Upload
| Setting | type | backend | propertyPath | Description |
|---|---|---|---|---|
| maxFilesize | number | true | validation.binary.maxFilesize | Max. allowed filesize (MB) |
| allowedTypes | select | true | validation.binary.allowedTypes | Selection list of allowed file types (the categories selected in the CMS — the same allowedTypes that the plugin then resolves into allowedFileTypes & allowedFileNames. The options should be defined in config.yml of forms plugin). |
| multiple | boolean | true | isList | Allow upload of multiple files |
1.6.1.8 usermail – User EMail Field
Sends an email to the entered address after the form was submitted.
| Setting | type | backend | propertyPath | Description |
|---|---|---|---|---|
| maxLength | number | true | validation.maxLength | Maximum number of allowed characters |
| mailsubject | translation | true | — | Subject of the email sent to the user |
| mailtemplate | select | true | — | Email template if set then the defined template inside forms plugin and the configured userEmailTemplateOptions is overwritten. |
1.6.1.9 adminmail
Element to specify which admin mail addresses submission notifications should be sent to. If such an element is present in the form, the form’s email property is ignored, and the recipients are instead taken from the selected option keys (which are mapped to the configured mail addresses). When no adminmail element is present, mail sending falls back to the admin email configured on the form (email).
| Setting | type | backend | propertyPath | Description |
|---|---|---|---|---|
| selectOptions | options | true | — | List of selectable key/value pairs |
1.6.2 Blocks (structure / layout)
| Block | Label | container | Settings |
|---|---|---|---|
| spacer | Spacer | false | none |
| group | Group | true | none |
| conditionalcontainer | Conditional container | true | none (contents are only active when the checked element has the expected value) |
| sectionheadline | Headline | false | text |
| text | Text | false | text |
container: true means the block can contain other elements (group, conditionalcontainer).
1.6.3 Other options (not per element – form-wide)
In addition, each form type defines options on the form level, e.g.:
- captchaOptions – selectable captcha variants offered when configuring the form’s spam protection (see the table below).
1.6.3.1 Captcha options (captchaOptions)
Each option is defined by a value (the identifier stored on the form) and a localized labelI18n.
| Value | Label (en) | Label (de) | Description |
|---|---|---|---|
| recaptcha_checkbox | Recaptcha: Checkbox | Recaptcha: Häckchen | Google reCAPTCHA rendered as an explicit “I’m not a robot” checkbox |
| recaptcha_invisible | Recaptcha: Background | Recaptcha: Hintergrund | Google reCAPTCHA that runs invisibly in the background (no checkbox) |
| friendly_auto | Friendly Captcha | Friendly Captcha | Friendly Captcha that starts its verification automatically |
| friendly_button | Friendly Captcha: Button | Friendly Captcha: Button | Friendly Captcha triggered via a button |
| friendly_background | Friendly Captcha: Background | Friendly Captcha: Hintergrund | Friendly Captcha that runs in the background |
captchaOptions only selects which captcha variant is used. The provider credentials and endpoints themselves — e.g. the reCAPTCHA / Friendly Captcha site key, secret / verification key and the verification URL — are not part of the form configuration. They must be configured in the forms plugin configuration (config.yml of the forms plugin), the same place where e.g. the binary allowedTypes are defined.
1.7 Form flows
A form flow controls the sequence of screens a user is guided through when filling out a form — for example the form itself, an optional summary, and a final success screen. Each form type defines its flows in the flows list of the General configuration; the first entry is used as the default. A flow determines which screens are shown, which buttons appear on each screen, and which additional variables are passed to the screen components.
This allows the form process to be tailored to a project’s needs, for example:
- Show or hide individual buttons (such as a print button on the summary screen).
- Pass variables that enable additional behaviour in a screen (such as showing detailed information in the summary).
- Add or remove screens, for example by inserting a summary step before submission.
The example configuration below defines two flows for the generic type: a default flow leading straight from the form to the success screen, and a with_summary flow that inserts a summary screen in between.
A flow has the following top-level fields:
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | Unique identifier of the flow. Used to reference the flow from a form. |
| labelI18n | translation map | required | Human-readable name of the flow, keyed by language code. |
| nameTranslationKey | string | optional | Translation key for the flow name. |
| steps | list of step configs | required | The ordered sequence of screens the user is guided through. See the step fields below. |
Each entry in steps describes a single screen:
| Field | Type | Required | Description |
|---|---|---|---|
| reactClass | string | required | The screen component to render, e.g. FormScreen, SummaryScreen or SuccessScreen. The available components are provided by FormGen. |
| buttonLabelTranslationKey | string | optional | Translation key for the label of the button on the preceding screen that navigates to this step. |
| nameTranslationKey | string | optional | Translation key for the screen title. |
| descriptionTranslationKey | string | optional | Translation key for the screen description. |
| buttons | list of button configs | optional | The navigation buttons shown in the screen footer. See the button fields below. |
| variables | list of key-value pairs | optional | Additional values passed to the screen component as properties. Each entry has a name and a value (e.g. showDetails: true to let the summary screen show detailed information). |
Each entry in buttons describes a single footer button:
| Field | Type | Required | Description |
|---|---|---|---|
| reactClass | string | required | The button component to render, e.g. SubmitButton, CancelButton, PreviousPageButton, NextPageButton, PrintPdfButton or DetailInfoButton. The available components are provided by FormGen. |
| labelTranslationKey | string | optional | Translation key for the button label. |
| mobileDisabled | boolean | optional | If true, the button is hidden on mobile devices (where the button component supports it). |
The screen and button components available as reactClass values are provided by FormGen and can be extended per project. For configuring and customizing these components see the FormGen Customizing Guide.
Assign at least one language to the node where you will be creating forms.
After this, the forms feature must be enabled for every node that should contain forms. Enable it per node in the Node Management tab of the administration interface, under the node’s Features.
Once the feature is enabled for a node, an additional Form Types tab appears for that node. Use it to assign the form types that should be available when creating forms in that node.
2 Implementation using Handlebars
For including forms into pages using Handlebars, a tagtype with two parts needs to be created:

The Handlebars Part should have the following template:
{{#gtx_form cms.tag.parts.form type="java"}}
{{{this}}}
{{else}}
{{gtx_i18n de="Kein Formular ausgewählt" en="No Form selected"}}
{{/gtx_form}}
For details on the gtx_form helper see Rendering with Handlebars
3 Rendering and customizing with FormGen
The forms configured above are rendered by FormGen. FormGen offers a wide range of configuration and customization options, such as custom form controls, lifecycle hooks, navigation buttons, overlays, screens and styling.
For all details on configuring and customizing the renderer, see the FormGen Customizing Guide
4 E-mail template pages
It is possible to create special pages in the CMS, which can be used as templates for mails, which are sent by forms (either admin mails or user mails).
The pages must be created from templates, which use the markup language Forms e-mail template and must render valid Handlebars code.
Those pages will be excluded from publishing, they will neither be written into the filesystem nor into a Content.Repository.
5 Forms Frontend Rendering
Forms are rendered on Client side with a provided React Component (=FormGen). The compiled JavaScript Application need to be part of your Portal so the Application can be included by the Forms-Directive. You have two Options:
- Download Pre-Compiled Ready to Use React-App and include in your portal
- Download Formgen Source Code and add it to your project for customization (build step required)
5.1 Use pre-compiled Frontend FormGen
You can download the builded Files from our Artifact-Server : https://repo.gentics.com/repository/maven-releases/com/gentics/cms/formgen/6.5.x/formgen-6.5.×.zip (use the correct CMS Version number) Or download it via maven dependency Plugin
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.6.1</version>
<executions>
<execution>
<id>copy-formgen</id>
<phase>prepare-package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.gentics.cms</groupId>
<artifactId>formgen</artifactId>
<version>6.5.0</version>
<type>zip</type>
<outputDirectory>/formgen</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
Place the downloaded Files in /portal/public/cpa/formgen (portal-php) or /portal/data/static/cpa/formgen (portal-java)
5.2 Download Sources & building
You can download the source Files from our Artifact-Server : https://repo.gentics.com/repository/maven-releases/com/gentics/cms/formgen/6.5.x/formgen-6.5.x-src.zip (use the correct CMS Version number) Or also download it via maven dependeny Plugin (see step nefore), just add the
You can now customize FormGen (see the FormGen Customizing Guide).
5.2.1 Building
For Building you need node and npm. In the extracted source Folder run
npm ci
// and in apps/andp-ma-formgen
npm run build
//you get a dist/_expo/ containing the builded Formgen
//Place it in
//portal-java: /portal/data/static/cpa/formgen/_expo
//portal-php: /portal/public/cpa/formgen/_expo
6 Redirect After Submission (successUrl)
A successUrl can be configured in the form properties to specify the page the user should be navigated to after successfully submitting a form.
6.1 Default Behavior
Because flows are individually configurable and an automatic redirect would restrict the flow execution, the navigation does not happen automatically. Instead, a button is displayed on the success screen whenever a successUrl is configured. The user must actively trigger the redirect by clicking the button.
This behavior is built into the default flow and requires no additional implementation.
6.2 Behavior With Customized Flows
If the flow is overridden or extended for a specific project, the default behavior no longer applies. In this case, the redirect logic must be implemented explicitly. Two options are available:
- Custom Elements: The logic for evaluating the successUrl and triggering the navigation is implemented directly within the custom element.
- Hook postSubmitForm: The redirect is handled via the postSubmitForm hook, which is called after the form has been submitted successfully.
In both cases, ensure that the successUrl is read from the form data and that the navigation is executed at the correct point in the flow.
The redirect handling for customized flows — custom elements or the postSubmitForm hook — is implemented and configured in FormGen (see the FormGen Customizing Guide).
.