Data modelling
Last updated
Last updated
Data models are what define the structure of your content. They define what types of content you have - such as new articles, categories, information pages - and how they interact with each other - a news article might belong to a category.
Models consist of fields. Fields are the properties or attributes that your model possess. A news article might have title, date and content fields.
In a new project that has no models, you will be taken directly to the model creation screen.
Otherwise, you can get to the model section by using the top navigation bar: Content > Models
Give your model a name, the alias will automatically populate. If you want to change the alias you can.
Description
Name
This is a friendly name for your model. It can be changed at any time.
Alias
This is how you refer to your model when querying content. You can change this at any time, however, it will affect any integrations you have built.
Usage
Inheritance
Click the "Save changes" button to create your model.
With your model created, you can now start adding fields. Click the "New field" button.
You only need to specify the name, alias and type to create a field. The additional configuration will be discussed in later topics.
Description
Name
This is a friendly name for your field. It can be changed at any time.
Alias
This is how you refer to your model when querying content. You can change this at any time, however, it will affect any integrations you have built.
Type
This defines what type of content your field will hold. See below for more information on the various field types.
Required
Indicates that this is a required field.
Single/Multiple values
Fields can be a single value or have multiple values.
Automatic source
Type
GraphQL
Description
Plain text
String
Simple plain text field
Rich text
JSON
Structure text field that allows embedding modules
Date
String
Simple date field. ISO-8601 formatted date
Numeric
Number
Integer or decimal number values
Boolean
Boolean
Yes/no, true/false
Linked content
PokEntry
References another entry
Modular content
PokValue
Allows for embedding content within the entry
Media
PokMedia
Links to an item in the media library
There are three sources of field validation. Validation is performed on Publish, not Save.
Required
Validation
Min/max on multiple value fields
This identifies the purpose of your model. Entries are top-level content such as web pages and categories. Modules are content that live inside other content - such as entries or nested within another module. See for more details.
This allows you to specify models to inherit properties from. See for a deeper look into this feature.
Field values can be derived from other sources. This is discussed in the section.