For Adobe ColdFusion application servers Key concepts

  • Pair of custom tags

    TerraForm is a pair of custom tags that replace or supplement your standard HTML form and field tags (there are actually four tags in all, but there are two key tags). All TerraForm forms must be wrapped in the cf_terraform custom tag. Each field within the form is created by a reference to the cf_terrafield custom tag (although you can also add in regular and CFML form fields).

  • Datatype and format

    Each form field has a "datatype" and a "format". These are essentially two independent characteristics of a field. The datatype is the type of information gathered by the field. The field's datatype controls the way the data is validated and processed. Examples would be "integer", "date", "string", or "email". The format is the nature of the field interface. Different interfaces (formats) suit different datatypes, but you are free to pick and choose. Examples of format would be "textarea", "calendar", "colorpicker", or "select".

  • External settings files

    All settings for TerraForm are contained in external settings files that you can (and should) extend or customise to your needs. Here you can add default values, custom error messages, datatype and format definitions, and the like. You can use multiple settings files within your site. You might have a different one for the admin area, for example, or for a Japanese section (with Japanese error messages).

  • Customising fields with presets

    Using a feature called presets, each format has a default datatype, and likewise each datatype has a default format. This means that normally you won't need to mention both the datatype and the format to build the field you want. Furthermore, you can use presets to specify any number of other default TerraField or attributes for different formats or datatypes. For example, you might choose the defaults rows="6" cols="40" for the textarea format -- you can always override it in your form. Presets reduce the number of keystrokes you need to build your field and increase consistency. Your presets are created in your settings files.

  • Boilerplate fields with presets

    Presets are a very powerful idea. They can also be used as boilerplate form fields independently of formats and datatypes. You can build an entire field simply by describing the name of a preset and the field name. You can set up a library of form fields you use regularly by declaring them using presets. TerraForm comes with some default presets. You can, for example create a country select box simply by typing <cf_terrafield preset="Country" name="country"/>. You can always append your own attributes or override the default attributes of the preset. For example:
ColdFusion Markup Language: Tag-based language processed by a ColdFusion web application server
HyperText Markup Language
The coding language used to create hypertext documents for use on the World Wide Web.
No comments yet