Metadata Plugin List

Overview

This overview contains a list of all metadata plugins provided by Livingdocs. Go to Metadata to get an overview of the metadata concept. You can create your own plugins in the downstream.

Metadata PluginMetadata Plugin TypeDescriptionUsage (D = Document, M = Media Library Entries, T = Table Dashboard, I = Includes)Default UI
Booleanli-booleanBooleanD, M, Tcheckbox
Colorli-colorColor CodeD, M, T, Itext
Categoryli-categorycategoryD, Tselect
Date/Time validityli-datetime-validityDateM2 date/time inputs
Date/Timeli-datetimeDateD, Mdate/time input
Dependenciesli-dependenciesLivingdocs framework dependencies definitionDno UI
Desk-Netli-desknet-integrationDesk-Net IntegrationDLink to Desk-Net distribution entry
Document Referenceli-document-referenceA reference to another documentD, M, Tdocument selection (dialog)
Enumli-enumstring from static list, validated on publishD, M, Tselect
Document Target Lengthli-target-lengthTarget length in characters for a documentDnumber input or length slider
Google Visionli-google-visionGoogle Vision Autotagging for ImagesMspecialized UI, no config possible
Imageli-imageImagesD, MImage selection/upload/crops
iMatricsli-imatrics-nlp-tagsiMatrics tag managementDmanage tags
Integerli-integerIntegerD, Mnumber input
Languageli-languageLanguageDselect
Metadata Translationsli-metadata-translationsEnable metadata translationsD (data record only), Mtranslation UI
Named Cropsli-named-cropsDefault Crops for ImagesMcrop management UI
Numeric Listli-numeric-listArray of NumbersD, Mmulti number input
Poster Imageli-poster-imagePoster Image for VideosM (Video)image selection
Publish Dateli-publish-dateHolds first publication date, user editableDdate/time input
Reference Listli-reference-listMultiple references to other documentsD, Mdocument selection (dialog)
Referenceli-referenceA reference to another documentD, Mdocument selection (dialog)
Retrescoli-retrescoRetresco tag managementDmanage tags
String Listli-string-listArray of StringsD, M, Tmultiselect
Stringli-textStringD, M, Ttext, textarea, select
Transcoding Stateli-transcoding-stateState of external transcoding jobM (Video)trigger transcoding, current job progress, result
Video Referenceli-video-referenceA reference to a video (and a poster image)D, M, IUpload/Media Library Picker for a Video and a Poster Image

li-boolean

A simple checkbox which you can turn on/off.

If you want to have the field checked on during document creation, you can do that via defaultMetadata in your projectConfig.

Storage Format: Boolean
Default UI: checkbox
UI: Renders a checkbox

Project Config

metadata: [
  {
    type: 'li-boolean',
    config: {
      // common
      hideFromForm: false                      // optional, default: false
    }
    ui: {
      label: 'foo',                            // optional, takes camelized name otherwise
      config: {
        readOnly: true                         // optional, default: false
      }
    }
  }
]

li-color

li-color will provide you with 2 settings (based on useInputTypeColor)

  • useInputTypeColor: true - color picker which stores the HEX color code
  • useInputTypeColor: false - text field where you have to enter the HEX color code (e.g. #8CBA51)

Storage Format: String
Default UI: text
UI: Renders a text element + color field

image

Project Config

metadata: [
  {
    handle: 'color',
    type: 'li-color',
    config: {
      // common
      hideFromForm: false,                     // optional, default: false
      required: true,                          // optional, default: false
      requiredErrorMessage: 'Provide a value', // optional
      // specific
      translatable: true                       // optional, default: false, translations are only supported for data-record and mediaLibrary
    },
    ui: {
      label: 'your label',
      config: {
        useInputTypeColor: false,              // optional, default: true, shows a color picker
        readOnly: true,                        // optional, default: false
        placeholder: 'foo',                    // optional, takes camelized name otherwise
      }
    }
  }
]

li-category

Storage Format: {id: <String>, path: <String>}
Default UI: select with category tree view and search

li-datetime-validity

Storage Format: {from: ISO8601 String, to: ISO8601 String}
Default UI: 2 date/time inputs (liMetaDateTimeValidityForm)

li-datetime

Storage Format: <ISO8601 String>
Default UI: 2 date/time inputs (liMetaDatetimeForm)
UI: Renders a date and time picker element

image

Project Config

metadata: [
  {
    handle: 'date',
    type: 'li-datetime',
    config: {
      // common
      hideFromForm: false,                     // optional, default: false
      required: true,                          // optional, default: false
      requiredErrorMessage: 'Provide a value'  // optional
    },
    ui: {
      label: 'foo',                   // optional, takes camelized name otherwise
      config: {
        readOnly: true                // optional, default: false
      }
    }
  }
]

li-dependencies

Storage Format:

{
  js: [
    {
      src: <String>,
      code: <String>,
      inline: <Boolean>,
      library: <String>,
      namespace: <String>,
      componentIds: [
        <String>
      ]
    }
  ],
  css: [
    {
      src: <String>,
      code: <String>,
      inline: <Boolean>,
      library: <String>,
      namespace: <String>,
      componentIds: [
        <String>
      ]
    }
  ]
}

Default UI: no UI

li-desknet-integration

Storage Format:

{
  id: <Integer>,
  publicationId: <Integer>,
  platformId: <Integer>,
  categoryId: <Integer>
}

Default UI: Link to Desk-Net distribution entry

li-document-reference

Added in: release-2022-03

A li-document-reference metadata field shows a reference to another document. To select a document one gets provided a Document Selection Modal.

Storage Format:

{
  reference: {
    id: <String>
  }
}

Default UI: Document Selection (Dialog) (liMetaReferenceForm)

image

Project Config

// contentType[].metadata / mediaType[].metadata
metadata: [
  {
    handle: 'reference',
    type: 'li-document-reference',
    config: {
      // common
      hideFromForm: false,                     // optional, default: false
      required: true,                          // optional, default: false
      requiredErrorMessage: 'Provide a value', // optional
      // specific
      documentType: 'article',                 // optional, one of article, page, data-record
      contentType: 'my-content-type'           // optional, filters the document selection
      published: true,                         // optional, shorthand for publication displayFilter, default: false
    },
    ui: {
      label: 'foo',                  // optional, takes camelized name otherwise
      config: {
        // style: 'default' -> default for metadata
        // style: 'teaser' -> default for include paramsSchema
        // style: 'minimal' -> only show a selection element with a title (no modal)
        style: 'default',
        useDashboard: '',            // optional, reference to a custom dashboard
        baseFilters: [],             // optional, filters that the user can set in the UI (below the search input)
        displayFilters: [],          // optional, invisible filters and applied to every search (including the default result list)
      }
    }
  }
]

References:

li-enum

A li-enum metadata field shows a select form based on a statically defined list. On publish the selected value gets validated against the defined static list. With that you can assure that only specific values gets published.

Storage Format: <String>
Default UI: select

image

Project Config

// contentType[].metadata / mediaType[].metadata
metadata: [
  {
    handle: 'tags',
    type: 'li-enum',
    config: {
      // common
      hideFromForm: false,                     // optional, default: false
      required: true,                          // optional, default: false
      requiredErrorMessage: 'Provide a value', // optional
      // specific
      dataProvider: {                          // required
        type: 'labelValuePair',                // required
        items: [
          {label: 'Tag A', value: 'a'},
          {label: 'Tag B', value: 'b', isDefault: true}, // isDefault sets the value if document opened the first time
          {label: 'Tag C', value: 'c'}
        ]
      }
    },
    ui: {
      label: 'foo',                   // optional, takes camelized name otherwise
      config: {
        readOnly: true,               // optional, default: false
        placeholder: 'foo',           // optional, takes camelized name otherwise
      }
    }
  }
]

li-document-soft-lock

Storage Format:

{
  userId: <Integer>,
  userName: <String>,
  locktime: <ISO8601 String>,
  tabId: <String>
}

Default UI: no UI

li-google-vision

Storage Format: {}
Default UI: specialed UI in the Media Library Image Detail View, no config possible

li-image

Storage Format:

{
  originalUrl: <String,
  url: <String>,
  mediaId: <String>,
  height: <Integer>,
  width: <Integer>,
  mimeType: <String>,
  imageService: <String>,
  crops: [
    <Object>
  ]
}

Default UI: UI to select/upload/delete/crop an image (liMetaImageForm)

li-imatrics-nlp-tags

Storage Format:

{
  contentVersion: <String>,
  concepts: [
    {
      weight: <Number>,
      title: <String>,
      slug: <String>,
      type: <String>,
      uuid: <String>,
      inappropriate: <Boolean>,
      userAdded: <Boolean>
    }
  ]
}

Default UI: manage tags, add new tag suggestions (liMetaIMatricsForm)

li-integer

Storage Format: <Integer>
Default UI: number input (liMetaIntegerForm)
UI: Renders a number input. No UI is rendered if the handle is lastProofreadRevision.

Project Config

metadata: [
  {
    handle: 'integer',
    type: 'li-integer',
    config: {
      // common
      hideFromForm: false,                     // optional, default: false
      required: true,                          // optional, default: false
      requiredErrorMessage: 'Provide a value', // optional
      // specific
      minValue: 1,                             // optional
      maxValue: 50                             // optional
    },
    ui: {
      label: 'foo',                   // optional, takes camelized name otherwise
      config: {
        placeholder: 'bar',           // optional, takes camelized name otherwise
        readOnly: true,               // optional, default: false
      }
    }
  }
]

li-language

Storage Format:

{
  locale: <String>,
  label: <String>,
  groupId: <String>
}

Default UI: language selection

  • This works together with the languageSelection service.

li-metadata-translations

When adding li-metadata-translations, it allows a user to translate metadata into different languages. Metadata translations are supported for the Media Library and Data Records.

Storage Format: {locale: <String>}
Default UI: translation UI image

Project Config

// contentType[].metadata / mediaType[].metadata
metadata: [
  {
    handle: 'language',
    type: 'li-metadata-translations',
    ui: {
      component: 'liMetaSelectForm',
      service: 'languageSelection'
    }
  }
]

li-named-crops

Storage Format:

{
  crops: [
    {
      name: <String>,
      x: <Integer>,
      y: <Integer>,
      width: <Integer>,
      height: <Integer>,
      isAutomatic: <Boolean>
    }
  ]
}

Default UI: crop management (liMetaNamedCropsForm)

li-numeric-list

Storage Format: [<Number>]
Default UI: input for multiple numbers (liMetaNumericList)

Numeric List Example

Project Config

metadata: [
  {
    handle: 'otherIds',
    type: 'li-numeric-list',
    config: {
      // common
      required: true,                                   // optional, default: false
      requiredErrorMessage: 'Custom required message',  // optional
      // specific
      maxItems: 5,                                      // optional
    },
    ui: {
      label: 'foo',                   // optional, takes camelized name otherwise
      config: {
        placeholder: 'bar',           // optional, takes capitalized handle name otherwise
        readOnly: true                // optional, default: false
      }
    }
  }
]

li-poster-image

Storage Format:

{
  originalUrl: <String>,
  url: <String>,
  mediaId: <String>,
  height: <Integer>,
  width: <Integer>,
  mimeType: <String>,
  imageService: <String>,
  crops: [
    {
      name: <String>,
      x: <Integer>,
      y: <Integer>,
      width: <Integer>,
      height: <Integer>,
      isAutomatic: <Boolean>
    }
  ]
}

Default UI: Poster Image selection, has some special UI within Video Media Library Entries (liMetaPosterImageForm)

li-publish-date

Storage Format: <ISO8601 String>
Default UI: date/time input (liMetaDatetimeForm)

li-reference-list

Storage Format:

{
  $ref: 'documents',
  references: [{
    id: <String>
  }]
}

Default UI: Document Selection (Dialog) (liMetaReferenceForm)

li-reference

A li-reference metadata field shows a reference to another document. To select a document one gets provided a Document Selection Modal. If you don’t want to use the prefillAuthor property, use li-document-reference.

Storage Format:

{
  $ref: 'document',
  reference: {
    id: <String>
  }
}

Default UI: Document Selection (Dialog) (liMetaReferenceForm)

image

Project Config

metadata: [
  {
    handle: 'reference',
    type: 'li-reference',
    config: {
      // common
      hideFromForm: false,                     // optional, default: false
      required: true,                          // optional, default: false
      requiredErrorMessage: 'Provide a value', // optional
      // specific
      documentType: 'data-record',             // optional
      contentType: 'author',                   // optional
      prefillAuthor: true                      // optional, default: false
      published: true,                         // optional, shorthand for publication displayFilter, default: false
    },
    ui: {
      label: 'foo',                            // optional, takes camelized name otherwise
      component: 'liMetaReferenceForm',
      config: {
        displayFilters: ['timeRange']
      }
    }
  }
]

References:

li-retresco

Storage Format:

{
  contentVersion: <String>,
  entities: [{
    id: <String>,
    type: <String>,
    name: <String>,
    score: <Number>,
    inappropriate: <Boolean>,
    userAdded: <Boolean>
  }]
}

Default UI: Retresco tag management (liMetaRetrescoForm)

Please see the Retresco integration guide for details on how to setup the integration.

li-string-list

Storage Format: Array of Strings
Default UI: Multiselect

Needs a dataProvider to work.

Project Config

// contentType[].metadata / mediaType[].metadata
metadata: [
  {
    handle: 'myStringList',
    type: 'li-string-list',
    config: {
      // common
      hideFromForm: false,                     // optional, default: false
      required: true,                          // optional, default: false
      requiredErrorMessage: 'Provide a value', // optional
      // specific
      dataProvider: { // required
        // Option 1 - list of items
        type: 'labelValuePair',
        items: [
          {label: 'Item A', value: 'a'},
          {label: 'Item B', value: 'b', isDefault: true}, // isDefault sets the value if document opened the first time
          {label: 'Item C', value: 'c'}
        ]
        // Option 2 - DataSource
        dataSource: 'labelValuePairDataSource'
      }
    },
    ui: {
      label: 'foo', // optional, takes camelized name otherwise
      config: {
        readOnly: true, // optional, default: false
      }
    }
  }
]

li-target-length

Storage Format: {characters: <Number>}
Default UI: Number input (LiMetaTargetLengthForm)

Doesn’t work if the editor config metadata.useAngularBasedFormRendering is true.

Project Config

// contentType[].metadata / mediaType[].metadata
metadata: [
  {
    handle: 'targetLength',
    type: 'li-target-length',
    // optional, allows picking a step instead of entering an exact number
    ui: {
      config: {
        steps: [
          {
            label: 'S', // use a short one, e.g. "S" "M" "L"
            value: 100 // number of characters
          },
          {
            label: 'M',
            value: 200
          }
        ],
        // optional, allows the input of an exact number besides picking a step
        allowAnyNumber: true
      }
    }
  }
]

li-text

Storage Format: String
Default UI: text input, textarea, select
UI:

  • Renders a select element if a dataProvider is configured
  • Renders a textarea if ui.component is set to LiMetaFormTextarea
  • Renders a text input otherwise

Project Config

metadata: [
  {
    handle: 'title',
    type: 'li-text',
    config: {
      // common
      hideFromForm: false,                     // optional, default: false
      required: true,                          // optional, default: false
      requiredErrorMessage: 'Provide a value', // optional
      // specific
      maxLength: 200,                          // optional
      useAsTitle: true,                        // default: false, synchronises the value with document.title if true
      translatable: true,                      // optional, default: false, translations are only supported for data-record and mediaLibrary
      dataProvider: {                          // optional
        // Option 1 - list of items
        type: 'labelValuePair',
        items: [
          {label: 'Item A', value: 'a'},
          {label: 'Item B', value: 'b', isDefault: true}, // isDefault sets the value if document opened the first time
          {label: 'Item C', value: 'c'}
        ]
        // Option 2 - DataSource
        dataSource: 'labelValuePairDataSource'
      }
    },
    ui: {
      label: 'foo',                   // optional, takes camelized name otherwise
      config: {
        placeholder: 'bar',           // optional, takes camelized name otherwise
        readOnly: true,               // optional, default: false
        rows: 10                      // optional, only applicable for LiMetaFormTextarea, integer, 5 by default
      }
    }
  }
]

li-transcoding-state

Storage Format:

{
  commands: [{
    assetKey: <String>,
    commandId: <String>,
    createdAt: <String>,
    state: <String>,
    errorMessage: <String>,
    progress: <Number>
  }],
  transcodings: [{
    assetKey: <String>
  }]
}

Default UI: UI to trigger transcodings, see progress and the result in the end (liMetaTranscodingStateForm)

li-video-reference

Added in: release-2022-03

A li-video-reference metadata field shows a list of video references where one entry can be selected. Optionally a customer poster image can be defined. li-video-reference is only supported property in includes.

Storage Format:

{
  $ref: 'video',
  reference: {
    id: <String>,
    posterImageId: <String>
  }
}

Default UI: Video & Poster Image Upload/Media Library Selection

image

Config

paramsSchema: [
  {
    handle: 'video',
    type: 'li-video-reference',
    config: {
      // common
      hideFromForm: false,                     // optional, default: false
      required: true,                          // optional, default: false
      requiredErrorMessage: 'Provide a value', // optional
      // specific
      translatable: true,                      // optional, default: false, translations are only supported for data-record and mediaLibrary
    },
    ui: {
      config: {
        posterImageUploadMediaType: 'image2',  // optional, default: 'image'
      }
    }
  }
]

Legacy Docs

Image

ContentType metadata config:

metadata: [
  {
    handle: 'teaserImage',
    type: 'li-image',
    config: {
      // common
      hideFromForm: false,                     // optional, default: false
      required: true,                          // optional, default: false
      requiredErrorMessage: 'Provide a value', // optional
      // specific
      imageRatios: ['16:9', '1:1']
    },
    ui: {
      component: 'liMetaImageForm'
    }
  }
]

This defines an image with two crops: 16:9 and 1:1.

You can automatically extract images from the document and set the metadata automatically unless you change the metadata manually at which point the automatic extraction will stop.

fieldExtractor: [
  {
    // the metadata field 'teaserImage' is the target of this extraction
    identifier: 'teaserImage',
    // the extraction is of type image
    type: 'image',
    // extract from component 'image' the value in the directive 'image'
    matches: ['image.image']
  }
]

This would autofill the metadata property ‘teaserImage’ with the first image from the document in a ‘image’ component.

Datetime

ContentType metadata config:

metadata: [
  {
    ...,
    ui: {
      component: 'liMetaDatetimeForm',
      service: 'customServicePlugin',  // optional
      label: 'foo'                     // optional, takes camelized name otherwise
    }
  }
]

You need to make sure that your server-side metadata field is of type li-datetime or a suitable custom format, otherwise you will get errors. The service option lets you customize the business logic of a metadata form field. Check the section “registering a metadata service” later on how to register a service. The service plugin for a datetime allows you to customize the logic for the following methods:

{
  // set the date, possibly applying formatting options
  setDate (identifier, value) {},

  // get the date, possibly applying formatting options
  getDate (identifier) {},

  // this lets you define what dates a user can select in the UI. Handy if you want for example
  // to disallow past dates.
  isValidDate (date) {}
}

There is a sample implementation in plugins/metadata_services/default_date_service.coffee to help you get started.

Reference List

Stores an array of multiple document ids, not to be confused with List Reference.

Reference List Example

ContentType metadata config for a reference list:

metadata: [
  {
    ...,
    type: 'li-reference-list',
    config: {
      // common
      hideFromForm: false,                     // optional, default: false
      required: true,                          // optional, default: false
      requiredErrorMessage: 'Provide a value', // optional
      // specific
      referenceType: 'documents'
      displayFilters: []
    },
    ui: {
      component: 'liMetaReferenceForm',
      config: {
        sortable: true, // enable sorting by drag and drop
        displayFilters: [] // enable display filters
      }
    }
  }
]

List Reference

Stores a single id of a list, not to be confused with Reference List.

List Reference Example

Config for a list reference:

metadata: [
  {
    ...,
    type: 'li-list-reference',
    config: {
      // common
      hideFromForm: false,                     // optional, default: false
      required: true,                          // optional, default: false
      requiredErrorMessage: 'Provide a value', // optional
      // specific
      enableCount: true,      // enable UI configuration of number of articles (default: false)
      defaultCount: 3,        // number of articles shown by default (default: 3)
      minCount: 2,            // minimum number of articles
      maxCount: 6,            // maximum number of articles
      enableListEditing: true // allow to create/edit list inline (default: false)
    }
  }
]