li-document-references

History
VersionChange
release-2025-05Table dashboard support was added in the 2025-05 release.

Supported Features

Document
Media
Include
Document Creation Flow
Push Message
Usage Log
Table Dashboard
Display Filter
Search Indexing
System Metadata
Planning System
Webhook Conditions

Description

A li-document-references metadata field is a list of references to other documents. A Document Selection Dialog is shown, based on shorthand queries and useDashboard to select documents.

Default UI

Selected documents, or document selection dialog

An Author field with the document John Doe selected, next to a Change link that opens the selection dialog

Storage Format

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

Content Type Config

{
  handle: 'myContentType',
  // ...
  metadata: [
    {
      handle: 'myHandle'
      type: 'li-document-references',
      config: {
        // common
        hideFromForm: false,                     // optional, default: false
        required: true,                          // optional, default: false
        requiredErrorMessage: 'Provide a value', // optional
        index: true,                             // optional, default: false
        // 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
        prefillAuthor: true,                     // optional, add document creator if the prefilling configuration for the current user exists, default: false
        min: 2,                                  // optional, minimum number of articles required. Use in combination with `required: true` if you would like to prevent `undefined` from being allowed
        max: 4                                   // optional, maximum number of articles required
      },
      ui: {
        label: 'foo',         // optional, takes camelized name otherwise
        config: {
          style: 'default',   // optional, defaults to 'default'. Other options: 'teaser' | 'minimal'
          useDashboard: '',   // optional, reference to a custom dashboard
          baseFilters: [],    // optional, extends base filters from the dashboard specified in useDashboard
          displayFilters: [], // optional, overrides display filters in selection dialog
          cacheSearch: false, // optional, used to persist search query and filters when reopening search dialog, default: false
          sortable: true,     // optional, allow drag and drop sorting of items (not compatible with `style: 'minimal'`), default: false
          readOnly: false     // optional, default: false
        }
      }
    }
    // ...
  ]
}