Iridium CMSIridium CMS

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:

  • allowedMediaType | MediaType[]
    The media types allowed. Allows any media by default.
  • displayNamestring
    The display name of the field. Defaults to the name of the property.
  • requiredboolean
    Whether the field is required. Defaults to false.
  • layoutLAYOUT
    The layout of the field in the admin. Defaults to 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:

  • allowedMediaType | MediaType[]
    The media types allowed. Allows any media by default.
  • minnumber
    The minimum number of media to reference. Defaults to 0.
  • maxnumber
    The maximum number of media to reference. Defaults to Infinity.
  • isRepeatableboolean
    Allows multiple of the same media to be referenced. Defaults to true.
  • displayNamestring
    The display name of the field. Defaults to the name of the property.
  • requiredboolean
    Whether the field is required. Defaults to false.
  • layoutLAYOUT
    The layout of the field in the admin. Defaults to LAYOUT.full.