Data Template Validation Fields
Data templates in Penzle allow you to define the structure and data types of content items in your website or application. To ensure that content authors are entering data correctly, you can use validation fields to specify rules for the values that can be entered into specific fields within a data template.
Validation Types
Penlze provides several types of validation fields that can be used to ensure that content authors enter data correctly and consistently. In this section, we'll discuss the different types of validation fields available in Penzle and provide examples of how to use them.
There are available validation types:
- RegEx Validator Field: This field allows you to define a regular expression that the field value must match. For example, you could use a RegEx validator to ensure that a phone number field only accepts numbers and hyphens.
- Required Field Validator: This field ensures a field must contain a value before the content item can be saved. This is useful for ensuring that important fields are filled in.
- Max Rule Validator: To specify a maximum value for a field. For example, to limit a numeric field to a maximum value of 100, follow these steps:
- Min Rule Validator: To specify a minimum value for a field. For example, to require a numeric field to have a minimum value of 1.
- Range Validator: To specify a range of acceptable values for the field, you can use Min and Max Rule validation. For example, you could use a Range validator to ensure that a numeric field only accepts values between 1 and 100.
Adding Validation Fields to a Data Template
Validation fields can specify rules for the values that can be entered into specific fields within a data template. You can apply multiple validation rules to a single field.
To add a validation field to a data template, follow these steps:
- Go to Development > Data Templates and navigate to the data template you want to add the validation field.
- Select the field to which you want to add the validation and select the Validation tab.
- Select the type of validation field you want to add.
- Configure the validation fields settings, such as the regular expression pattern or minimum acceptable values.
- Click Save.