You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Configuring child collections in Umbraco UI Builder, the backoffice UI builder for Umbraco.
2
+
description: Configuring child collections in Umbraco UI Builder.
3
3
---
4
4
5
5
# Child Collections
@@ -8,40 +8,52 @@ description: Configuring child collections in Umbraco UI Builder, the backoffice
8
8
This page is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
9
9
{% endhint %}
10
10
11
-
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](the-basics.md)config builder API except child collections cannot contain further child collections.
11
+
A child collection is a container for data models that are tied to a parent collection. The child collection system shares the [Collections](the-basics.md)API, offering flexibility for managing and displaying related data within your backoffice UI.
**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](child-collection-groups.md). By using this you can group child collections under a single context app with the inner child collections then being presented in tabs.
17
-
{% endhint %}
15
+
By default, child collections are displayed as context apps within the parent model's editor view. If multiple child collections lead to an overcrowded context apps area, consider using the [Child Collection Groups API](child-collection-groups.md). Using the API, you can group related child collections under a single context app, with each child collection appearing in separate tabs.
16
+
17
+
## Defining a Child Collection
18
+
19
+
To define a child collection, use the `AddChildCollection` method on the given collection config builder instance.
18
20
19
-
##Defining a child collection
21
+
### Using the `AddChildCollection()` Method
20
22
21
-
You define a child collection by calling one of the `AddChildCollection` methods on a given collection config builder instance.
23
+
This method adds a child collection with the specified names, description, and default icons. Both the entity ID and foreign key fields must be specified using property accessor expressions.
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.
31
+
#### Example
26
32
27
33
```csharp
28
-
// Example
29
34
collectionConfig.AddChildCollection<Child>(c=>c.Id, c=>c.ParentId, "Child", "Children", "A collection of children", childCollectionConfig=> {
### Using the `AddChildCollection()` Method with Custom Icons
40
+
41
+
This method adds a child collection to the current collection with the specified names, description and custom icons. Both the entity ID and foreign key fields must be specified using property accessor expressions.
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.
49
+
#### Example
37
50
38
51
```csharp
39
-
// Example
40
52
collectionConfig.AddChildCollection<Child>(c=>c.Id, c=>c.ParentId, "Child", "Children", "A collection of children", "icon-umb-users", "icon-umb-users", childCollectionConfig=> {
41
53
...
42
54
});
43
55
```
44
56
45
-
## Configuring a child collection
57
+
## Configuring a Child Collection
46
58
47
-
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](the-basics.md).
59
+
Child collections share the same API as the `Collection` config builder API, except child collections cannot contain further child collections. For more information, see the [Basics](the-basics.md) article.
0 commit comments