Configuring child collections in Umbraco UI Builder, the backoffice UI builder for Umbraco.
A child collection is a container for a given data model that is tied to a parent collection data model. It shares all of the Collections config builder API except child collections cannot contain further child collections.
Child Collections UI: By default, child collections will be presented in the UI as context apps in the parent models editor view. If you have multiple child collections that make the context apps area overpopulated, you can use the Child Collection Groups API. By using this you can group child collections under a single context app with the inner child collections then being presented in tabs.
You define a child collection by calling one of the AddChildCollection
methods on a given collection config builder instance.
Adds a child collection to the current collection with the given names and description and default icons. A property accessor expression is required for both the entity ID field and FK (Foreign Key) field of the entity.
Adds a child collection to the current collection with the given names, description and icons. A property accessor expression is required for both the entity ID field and FK (Foreign Key) field of the entity.
Child collections share the same API as the Collection
config builder API, except child collections cannot contain further child collections. For more information check the core collections documentation.
Configuring **one-to-many** relationships in Umbraco UI Builder, the backoffice UI builder for Umbraco.
Retrieving child collections in one-to-many relationships with UI Builder, can be achieved with the support of child repositories. One-to-many relations are where one parent entity of a collection is associated with multiple entities from another.
The models would look like this:
You can create child repository instances via the IRepositoryFactory
and use them to retrieve information from the child collection.
Configuring child collection groups in Umbraco UI Builder, the backoffice UI builder for Umbraco.
A child collection group is a container for other child collections. Its purpose is mainly to provide a logical grouping of multiple child collections to help with organization and an improved user experience.
You can define a child collection group by calling one of the AddChildCollectionGroup
methods on a given collection config builder instance.
Adds a child collection group to the current collection with the given name and default icon.
Adds a child collection group to the current collection with the given name and icon.