Files

378 lines
8.8 KiB
Markdown
Raw Permalink Normal View History

2023-10-30 22:49:27 +02:00
---
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}]`
2023-10-31 01:48:29 +02:00
- **group**: The group that this field belongs to
2023-10-30 22:49:27 +02:00
### 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
2023-10-31 01:48:29 +02:00
- **group**: The group that this field belongs to
2023-10-30 22:49:27 +02:00
### 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
2023-10-31 01:48:29 +02:00
- **group**: The group that this field belongs to
2023-10-30 22:49:27 +02:00
### 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
2023-10-31 01:48:29 +02:00
- **group**: The group that this field belongs to
2023-10-30 22:49:27 +02:00
### 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
2023-10-31 01:48:29 +02:00
- **group**: The group that this field belongs to
2023-10-30 22:49:27 +02:00
### checkbox
2023-10-31 01:48:29 +02:00
True or false
2023-10-30 22:49:27 +02:00
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
2023-10-31 01:48:29 +02:00
- **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
2023-10-30 22:49:27 +02:00
### block
The block editor
2023-10-31 01:48:29 +02:00
required
2023-10-30 22:49:27 +02:00
2023-10-31 01:48:29 +02:00
- **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