type

Data Type: String

Default: string

The type of field.

This is super important! The type of field you choose will determine the behavior of this field in Sapwood's UI, but it will also determine what is returned when accessing an element's attributes via the API.

Your options are:

  • boolean: Checkbox returning true or false.
  • date: A date picker that returns the date as a String.
  • element*: A dropdown menu of elements with the specified template and returns the selected elements.
  • elements*: A multi-select function that enables you to select multiple associated elements, which are returned as an array of elements.
  • geocode**: A textarea that is meant for an address and will store address parts if it can be geocoded.
  • select: A dropdown of the specified options as Strings.
  • string: A simple text field that returns a string.
  • text: A textarea that will return the text as a string, or plain text.
  • wysiwyg: A WYSIWYG editor that will return the HTML as a string.

* Element(s) fields are a powerful way to associate elements to one another. It's recommended that you use the template option in conjunction with either of these field types so you limit what can be chosen.

Also note there is hidden special behavior for element(s) fields where the only template specified is a document template. In this case the field is rendered as an uploader or file picker and not as a dropdown menu.

** Geocoding was one of the earlier features of Sapwood. We used to think it was pretty freaking cool, but it's been a major headache lately. Without proper support from the community, this feature will be phased out at some point in v2.x.