378 lines
8.8 KiB
Markdown
378 lines
8.8 KiB
Markdown
---
|
|
gitea: none
|
|
include_toc: true
|
|
---
|
|
|
|
# Fields
|
|
|
|
Fields are similar to a table's columns in a relational databases.
|
|
|
|
## Available fields for Collections and Files
|
|
|
|
### text
|
|
One-line text input
|
|
|
|
required
|
|
|
|
- **name**: The id of the field
|
|
- **label**: The friendly name of the field
|
|
|
|
optional
|
|
|
|
- **required**: Is the field required to save the record
|
|
- **nullable**: Can the field be saved as null
|
|
- **min**: Minimum characters
|
|
- **max**: Maximum characters
|
|
- **help**: Help text
|
|
- **default**: Default value when creating new record
|
|
- **readonly**: Cannot edit this value from the UI
|
|
- **optionsFrom**: Schema to choose options from
|
|
- **optionsField**: Field's value to insert
|
|
- **optionsSuggest**: Allow to insert new values
|
|
- **selectOptions**: Array of options to select from. Or array of objects `[{value,label}]`
|
|
- **group**: The group that this field belongs to
|
|
|
|
### textarea
|
|
textarea input
|
|
|
|
required
|
|
|
|
- **name**: The id of the field
|
|
- **label**: The friendly name of the field
|
|
|
|
optional
|
|
|
|
- **required**: Is the field required to save the record
|
|
- **nullable**: Can the field be saved as null
|
|
- **min**: Minimum characters
|
|
- **max**: Maximum characters
|
|
- **help**: Help text
|
|
- **default**: Default value when creating new record
|
|
- **readonly**: Cannot edit this value from the UI
|
|
- **group**: The group that this field belongs to
|
|
|
|
### slug
|
|
Slug input. Generates automatically if left empty
|
|
|
|
required
|
|
|
|
- **name**: The id of the field
|
|
- **label**: The friendly name of the field
|
|
- **source**: The source field from which it generates
|
|
|
|
optional
|
|
|
|
- **required**: Is the field required to save the record
|
|
- **nullable**: Can the field be saved as null
|
|
- **min**: Minimum characters
|
|
- **max**: Maximum characters
|
|
- **help**: Help text
|
|
- **default**: Default value when creating new record
|
|
- **readonly**: Cannot edit this value from the UI
|
|
- **group**: The group that this field belongs to
|
|
|
|
### rich
|
|
WYSIWYG editor
|
|
|
|
required
|
|
|
|
- **name**: The id of the field
|
|
- **label**: The friendly name of the field
|
|
|
|
optional
|
|
|
|
- **required**: Is the field required to save the record
|
|
- **nullable**: Can the field be saved as null
|
|
- **min**: Minimum characters
|
|
- **max**: Maximum characters
|
|
- **help**: Help text
|
|
- **default**: Default value when creating new record
|
|
- **readonly**: Cannot edit this value from the UI
|
|
- **group**: The group that this field belongs to
|
|
|
|
### number
|
|
Any numeric value
|
|
|
|
required
|
|
|
|
- **name**: The id of the field
|
|
- **label**: The friendly name of the field
|
|
|
|
optional
|
|
|
|
- **decimals**: default is 0
|
|
- **required**: Is the field required to save the record
|
|
- **nullable**: Can the field be saved as null
|
|
- **min**: Minimum characters
|
|
- **max**: Maximum characters
|
|
- **help**: Help text
|
|
- **default**: Default value when creating new record
|
|
- **readonly**: Cannot edit this value from the UI
|
|
- **optionsFrom**: Schema to choose options from
|
|
- **optionsField**: Field's value to insert
|
|
- **optionsSuggest**: Allow to insert new values
|
|
- **group**: The group that this field belongs to
|
|
|
|
### checkbox
|
|
True or false
|
|
|
|
required
|
|
|
|
- **name**: The id of the field
|
|
- **label**: The friendly name of the field
|
|
|
|
optional
|
|
|
|
- **required**: Is the field required to save the record
|
|
- **nullable**: Can the field be saved as null
|
|
- **help**: Help text
|
|
- **default**: Default value when creating new record
|
|
- **readonly**: Cannot edit this value from the UI
|
|
- **group**: The group that this field belongs to
|
|
|
|
### color
|
|
Color picker
|
|
|
|
required
|
|
|
|
- **name**: The id of the field
|
|
- **label**: The friendly name of the field
|
|
|
|
optional
|
|
|
|
- **required**: Is the field required to save the record
|
|
- **nullable**: Can the field be saved as null
|
|
- **help**: Help text
|
|
- **default**: Default value when creating new record
|
|
- **readonly**: Cannot edit this value from the UI
|
|
- **optionsFrom**: Schema to choose options from
|
|
- **optionsField**: Field's value to insert
|
|
- **optionsSuggest**: Allow to insert new values
|
|
- **selectOptions**: Array of options to select from. Or array of objects `[{value,label}]`
|
|
- **group**: The group that this field belongs to
|
|
|
|
### date
|
|
Date select
|
|
|
|
required
|
|
|
|
- **name**: The id of the field
|
|
- **label**: The friendly name of the field
|
|
|
|
optional
|
|
|
|
- **required**: Is the field required to save the record
|
|
- **nullable**: Can the field be saved as null
|
|
- **min**: Minimum date
|
|
- **max**: Maximum date
|
|
- **help**: Help text
|
|
- **default**: Default value when creating new record
|
|
- **readonly**: Cannot edit this value from the UI
|
|
- **optionsFrom**: Schema to choose options from
|
|
- **optionsField**: Field's value to insert
|
|
- **optionsSuggest**: Allow to insert new values
|
|
- **selectOptions**: Array of options to select from. Or array of objects `[{value,label}]`
|
|
- **group**: The group that this field belongs to
|
|
|
|
### datetime
|
|
Date and time selector
|
|
|
|
required
|
|
|
|
- **name**: The id of the field
|
|
- **label**: The friendly name of the field
|
|
|
|
optional
|
|
|
|
- **required**: Is the field required to save the record
|
|
- **nullable**: Can the field be saved as null
|
|
- **min**: Minimum date
|
|
- **max**: Maximum date
|
|
- **help**: Help text
|
|
- **default**: Default value when creating new record
|
|
- **readonly**: Cannot edit this value from the UI
|
|
- **optionsFrom**: Schema to choose options from
|
|
- **optionsField**: Field's value to insert
|
|
- **optionsSuggest**: Allow to insert new values
|
|
- **selectOptions**: Array of options to select from. Or array of objects `[{value,label}]`
|
|
- **group**: The group that this field belongs to
|
|
|
|
### json
|
|
Json data
|
|
|
|
required
|
|
|
|
- **name**: The id of the field
|
|
- **label**: The friendly name of the field
|
|
|
|
optional
|
|
|
|
- **required**: Is the field required to save the record
|
|
- **nullable**: Can the field be saved as null
|
|
- **help**: Help text
|
|
- **default**: Default value when creating new record
|
|
- **readonly**: Cannot edit this value from the UI
|
|
- **group**: The group that this field belongs to
|
|
|
|
### markdown
|
|
Markdown editor
|
|
|
|
required
|
|
|
|
- **name**: The id of the field
|
|
- **label**: The friendly name of the field
|
|
|
|
optional
|
|
|
|
- **required**: Is the field required to save the record
|
|
- **nullable**: Can the field be saved as null
|
|
- **min**: Minimum characters
|
|
- **max**: Maximum characters
|
|
- **help**: Help text
|
|
- **default**: Default value when creating new record
|
|
- **readonly**: Cannot edit this value from the UI
|
|
- **group**: The group that this field belongs to
|
|
|
|
### file
|
|
Upload or select files
|
|
|
|
required
|
|
|
|
- **name**: The id of the field
|
|
- **label**: The friendly name of the field
|
|
- **collections**: File collections to choose from
|
|
|
|
optional
|
|
|
|
- **mime**: The mime types allowed to select
|
|
- **nullable**: Can the field be saved as null
|
|
- **min**: Minimum files
|
|
- **max**: Maximum files
|
|
- **help**: Help text
|
|
- **group**: The group that this field belongs to
|
|
|
|
|
|
### reference
|
|
Reference other records
|
|
|
|
required
|
|
|
|
- **name**: The id of the field
|
|
- **label**: The friendly name of the field
|
|
- **collections**: Collections to choose from
|
|
|
|
optional
|
|
|
|
- **nullable**: Can the field be saved as null
|
|
- **min**: Minimum files
|
|
- **max**: Maximum files
|
|
- **help**: Help text
|
|
- **group**: The group that this field belongs to
|
|
|
|
|
|
### block
|
|
The block editor
|
|
|
|
required
|
|
|
|
- **name**: The id of the field
|
|
- **label**: The friendly name of the field
|
|
- **schema**: The block schema name
|
|
|
|
optional
|
|
|
|
- **required**: Is the field required to save the record
|
|
- **nullable**: Can the field be saved as null
|
|
- **help**: Help text
|
|
- **default**: Default value when creating new record
|
|
- **readonly**: Cannot edit this value from the UI
|
|
- **group**: The group that this field belongs to
|
|
|
|
)
|
|
## Available fields for the Block Editor
|
|
|
|
### heading
|
|
Single-line text
|
|
|
|
required
|
|
|
|
- **name**: The id of the field
|
|
- **label**: The friendly name of the field
|
|
|
|
optional
|
|
|
|
- **min**: Minimum date
|
|
- **max**: Maximum date
|
|
- **default**: Default value when creating new record
|
|
|
|
### textarea
|
|
Multiline text
|
|
|
|
required
|
|
|
|
- **name**: The id of the field
|
|
- **label**: The friendly name of the field
|
|
|
|
optional
|
|
|
|
- **min**: Minimum date
|
|
- **max**: Maximum date
|
|
- **default**: Default value when creating new record
|
|
|
|
### rich
|
|
WYSIWYG editor
|
|
|
|
required
|
|
|
|
- **name**: The id of the field
|
|
- **label**: The friendly name of the field
|
|
|
|
optional
|
|
|
|
- **min**: Minimum date
|
|
- **max**: Maximum date
|
|
- **default**: Default value when creating new record
|
|
|
|
|
|
### markdown
|
|
Markdown editor
|
|
|
|
required
|
|
|
|
- **name**: The id of the field
|
|
- **label**: The friendly name of the field
|
|
|
|
optional
|
|
|
|
- **min**: Minimum date
|
|
- **max**: Maximum date
|
|
- **default**: Default value when creating new record
|
|
|
|
### file
|
|
Choose files
|
|
|
|
required
|
|
|
|
- **name**: The id of the field
|
|
- **label**: The friendly name of the field
|
|
- **collections**: File collections to choose from
|
|
|
|
optional
|
|
- **mime**: The mime types allowed to select
|
|
- **min**: Minimum date
|
|
- **max**: Maximum date
|
|
- **default**: Default value when creating new record
|
|
|
|
### reference
|
|
Choose files
|
|
|
|
required
|
|
|
|
- **name**: The id of the field
|
|
- **label**: The friendly name of the field
|
|
- **collections**: Collections to choose from
|
|
|
|
optional
|
|
- **min**: Minimum date
|
|
- **max**: Maximum date
|
|
- **default**: Default value when creating new record |