Reference View

When you want to display entities as a list of references within a collection, use the Reference Collection View Kind. This will render a basic list layout. Each item renders a default layout with the entity's name and icon. You can further customize the item layout by registering a custom Ref Collection Item when needed.

The default Collection Item Model used in a Reference Collection View is based on the following interface:

export interface UmbCollectionItemModel {
  unique: string;
  entityType: string;
  name?: string;
  icon?: string;
}

Register the Reference Collection View in the extension registry with the kind set to "ref":

Manifest

umbraco-package.json
{
  "type": "collectionView",
  "kind": "ref",
  "alias": "My.CollectionView.Ref",
  "name": "My Ref Collection View",
  "conditions": [
    {
      "alias": "Umb.Condition.CollectionAlias",
      "match": "My.Collection" // Collection alias to display this collection view for
    }
  ]
}

Custom Reference Collection Item

If you want to customize how each item is rendered, you can create and register a custom Ref Collection Item.

Manifest

Implementation

Implement your custom Ref Collection Item as a Lit element that extends UmbLitElement. This defines how an individual item is rendered in the collection.

Get more information on Reference elements and base element starting points at the UI Library documentationarrow-up-right

Last updated

Was this helpful?