Predefined FormΒΆ

Predefine form settings and make them selectable in plugin record.

TypoScript Path

plugin.tx_formhandler_form.settings.predefinedForms.FormName

Example Code:

plugin.tx_formhandler_form.settings.predefinedForms.devExample {
  formId = DevExampleForm
  formName = Dev Example Form
  formValuesPrefix = DevExampleForm
  langFileDefault = locallang_example_form.xlf
  templateForm = DevExample/Default
  templateMailHtml = DevExample/MailHtml
  templateMailText = DevExample/MailText

  conditionBlocks {
  }

  fileUpload {
  }

  debuggers {
  }

  steps {
    1 {
      templateForm = DevExampleForm/DevExampleHTMLStep1
      validators {
        DefaultValidator {
          model = DefaultValidator
          config {
            messageLimit = 1
            messageLimits {
              customer.email = 2
            }
            fields {
              customer.fields {
                firstname.errorChecks {
                  required {
                    model = Required
                  }
                  lengthMax {
                    model = LengthMax
                    lengthMax = 20
                  }
                }
                lastname.errorChecks {
                  required {
                    model = Required
                  }
                  lengthMax {
                    model = LengthMax
                    lengthMax = 20
                  }
                }
                streetAddress.errorChecks {
                  required {
                    model = Required
                  }
                }
                postalCode.errorChecks {
                  required {
                    model = Required
                  }
                }
                city.errorChecks {
                  required {
                    model = Required
                  }
                  lengthMax {
                    model = LengthMax
                    lengthMax = 70
                  }
                }
                country.errorChecks {
                  required {
                    model = Required
                  }
                }
                telephone.errorChecks {
                  required {
                    model = Required
                  }
                  lengthMax {
                    model = LengthMax
                    lengthMax = 20
                  }
                }
                email.errorChecks {
                  required {
                    model = Required
                  }
                  lengthMax {
                    model = LengthMax
                    lengthMax = 50
                  }
                  email {
                    model = Email
                  }
                }
              }
            }
          }
        }
      }
    }
  }

  finishers {
    Mail {
      model = MailFinisher
    }
    Redirect {
      model = RedirectFinisher
      config {
        returns = true
        correctRedirectUrl = false
        additionalParams {
          postal_code = 1.customer.postalCode
          queryParam2 = valueIfNotFoundAsFieldName
        }
      }
    }
  }
}

Properties

formId

Value of the id attribute of the form tag.

Mandatory

True

Data Type

String

formName

Value of the name shown in the dropdown list.

Mandatory

True

Data Type

String

formValuesPrefix

Prefix of form fields. Use this if you use a prefix for your forms to avoid conflicts with other plugins.
Settings this option you will be able to use only the fieldname in all markers and do not need to add prefix.

Mandatory

False

Data Type

String

Default

tx_formhandler_form

Note

It is highly recommended to use this setting!

langFileDefault

Path to default language file, can be altered as parameter by the form fields.

Mandatory

False

Data Type

String

conditionBlocks

Settings to handle condition block.

Mandatory

False

Data Type

Array<String, ConditionBlock>

fileUpload

Settings to handle file uploads.

Mandatory

False

Data Type

FileUpload

debuggers

A list of Debuggers for the predefined forms.

Mandatory

False

Data Type

Array<String, Debugger>

steps

You can split a form into as many steps as you like and add as many Validators as you like to each step,
but even if the form has just one step it must be defined to add Validators.

Mandatory

True (Only if a form has needs Validators, otherwise not.)

Data Type

Array<Integer, Step>

Note

The key Integer in Array<Integer, Step> starts at 1 for first step.

finishers

A list of Finishers for the predefined forms.

Mandatory

False

Data Type

Array<String, Finisher>