More About Defining Fields

The content-type element you will use most frequently is almost certainly the field element. It is also one of the more complicated elements in the content-type resource, so it is probably worth looking at it more closely.

The field element has a type attribute that determines what type of data the field will accept. The main type values are:


Accepts any string data, including XHTML fragments. This is the default field type.


Accepts only numbers.


Accepts only Boolean (true/false) values.


Accepts only values from a predefined list.


Accepts only URIs.


Accepts only date/time values.


Accepts only schedule definitions.


Accepts only values from an atom feed.

The type of a field determines not only what kind of data it is capable of accepting, but also:

  • What kind of constraints can be placed on the input data

  • What kind of child elements the field element may contain

  • What kind of data the field returns when accessed from a template, and therefore how the field is best accessed.

These types are described in more detail in the following sections. Also discussed are field arrays, complex fields and hidden fields.

Changing field type for any given field that is currently in use, is not supported. The behaviour if done is undefined.

For a complete list of all available field types, see here.