Fields: Defining Your Content's Data

Once you've established your Content Types, you populate them with fields. Fields define the specific pieces of data that each content entry will hold.

Purpose:

  • Data Specificity: Fields determine the type of information stored within your content types, ensuring data accuracy and consistency.
  • Content Detail: They provide the granular detail needed to populate your content, from simple text to complex structured data.
  • API Accessibility: Fields are the building blocks that make your content accessible and queryable through your headless CMS's API.

Supported Field Types:

  • Text: For short text strings.
  • Long Text (HTML/Markdown): For larger text content, including formatted text.
  • Reference: Links to other Content Types, establishing relationships.
  • Integer: Whole numbers.
  • Float: Decimal numbers.
  • Boolean: True/false values.
  • Date: Calendar dates.
  • Time: Time of day.
  • Date and Time: Combined date and time values.
  • Slug: URL-friendly string, often auto-generated from a label field.
  • JSON: Stores arbitrary JSON data.
  • Image: Uploaded image files, with API options for resizing and formatting.
  • Video: Uploaded video files.

Notes:

  • Some field types support multiple entries, allowing for lists or arrays of data.
  • Designating a Text field as a "label" is recommended for easy identification of content entries.
  • GraphQL API Access: Adding your first field to a Content Type immediately makes your content accessible through the CMS's GraphQL API.