media
| medias
The media
and medias
properties are used to reference media from the data lake.
Media
import { atom, media } from '@iridiumcms/core';
export const sample = atom('sample', {
myMedia: media(),
});
The media
field takes either a MediaType | MediaType[]
and optional configuration object or a optional configuration object:
- allowedThe media types allowed. Allows any media by default.
MediaType | MediaType[]
- displayNameThe display name of the field. Defaults to the name of the property.
string
- requiredWhether the field is required. Defaults to
boolean
false
. - layoutThe layout of the field in the admin. Defaults to
LAYOUT
LAYOUT.full
.
Medias
import { atom, medias } from '@iridiumcms/core';
export const sample = atom('sample', {
myList: medias({
allowed: ['image', 'video'],
min: 1,
max: 3,
}),
});
The medias
field takes either a MediaType | MediaType[]
and optional configuration object or a optional configuration object:
- allowedThe media types allowed. Allows any media by default.
MediaType | MediaType[]
- minThe minimum number of media to reference. Defaults to
number
0
. - maxThe maximum number of media to reference. Defaults to
number
Infinity
. - isRepeatableAllows multiple of the same media to be referenced. Defaults to
boolean
true
. - displayNameThe display name of the field. Defaults to the name of the property.
string
- requiredWhether the field is required. Defaults to
boolean
false
. - layoutThe layout of the field in the admin. Defaults to
LAYOUT
LAYOUT.full
.