Field types

Fields allow you to structure content in a way that makes sense for your website or application. Each resource type will have its own fields, however once you add a field you may reuse it on another resource type. For example, a "title" field can be created once then added to another resource type.

For data that should be displayed across all resource types, try adding a global field.

Adding fields

Under Structure > Resource types you can click the dropdown next to a resource type and select "Manage fields" to see the current list of fields. 

From this page, click the "Add field" button in the top right. If you wish to re-use an existing common field such as "title" you may select it from the dropdown. Re-used fields may have the same label by default or you can change it for this resource type.

To add a new field, click the "select field type" dropdown and make a choice.

Field types

Fields are broken up by type to store the appropriate value, for example an on/off toogle could be a Boolean, a title would be "plain text".

Other fields have specific purposes, such as dynamic collection or header metadata.

General

  • Boolean: Used for on/off, true/false etc.
  • Email: A field with validation for an email address.
  • Formatted text: This will display a wysiwyg so that full HTML content can be written that includes formatting like bold and italic, as well as making lists or links.
  • Image: Upload an image. This will appear in the api response as a url to the file on our cdn.
  • Plain text: Shorter text without formatting, such as a title or label.

HTML

  • Header metadata: Create a metatag with a text value. This value will be added to your page's <head>

Options

Rather than a single value, options can display lists where one or more value is selectable per resource.

  • Decimal: Numeric values with a decimal place
  • Integer: Numeric whole number values
  • Text: Text values, useful for tags or categories

Related resource(s)

Any resource can reference any other resource, this can be used to display a snippet of that resource's content using a unique schema mode or simply to have a link to it.

  • Dynamic collection: A collection field can be configured to show an arbitrary list of content
  • Selected resource(s): Create a direct reference to one or more other resources

Structured data

  • Paragraph: A component or other repeating "group" of fields which can be re-used across the project.

Displaying field data

By default, the data in fields is not public. To add a field to a resource API response, you must edit the default schema mode for a resource type.