Skip to content

Commit e2a4397

Browse files
authored
Merge pull request #6930 from umbraco/ui-builder-collections
Updated articles as per styleguide
2 parents 3dac777 + b2acd6d commit e2a4397

File tree

9 files changed

+722
-268
lines changed

9 files changed

+722
-268
lines changed

15/umbraco-ui-builder/collections/child-collection-groups.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
description: Configuring child collection groups in Umbraco UI Builder, the backoffice UI builder for Umbraco.
2+
description: Configuring child collection groups in Umbraco UI Builder.
33
---
44

55
# Child Collection Groups
@@ -12,27 +12,41 @@ A child collection group is a container for other child collections. Its purpose
1212

1313
![Child Collection Groups](../images/child_collection_groups.png)
1414

15-
## Defining a child collection group
15+
## Defining a Child Collection Group
1616

1717
You can define a child collection group by calling one of the `AddChildCollectionGroup` methods on a given collection config builder instance.
1818

19-
### **AddChildCollectionGroup(string name, Lambda childCollectionGroupConfig = null) : ChildCollectionGroupConfigBuilder**
19+
### Using the `AddChildCollectionGroup()` Method
2020

21-
Adds a child collection group to the current collection with the given name and default icon.
21+
Adds a child collection group to the current collection with the specified name and default icon.
22+
23+
#### Method Syntax
24+
25+
```cs
26+
AddChildCollectionGroup(string name, Lambda childCollectionGroupConfig = null) : ChildCollectionGroupConfigBuilder
27+
```
28+
29+
#### Example
2230

2331
```csharp
24-
// Example
2532
collectionConfig.AddChildCollectionGroup("Family", childCollectionGroupConfig => {
2633
...
2734
});
2835
```
2936

30-
### **AddChildCollectionGroup(string name, string icon, Lambda childCollectionGroupConfig = null) : ChildCollectionGroupConfigBuilder**
37+
### Using the `AddChildCollectionGroup()` Method with Custom Icon
38+
39+
Adds a child collection group to the current collection with the specified name and custom icon.
40+
41+
#### Method Syntax
42+
43+
```cs
44+
AddChildCollectionGroup(string name, string icon, Lambda childCollectionGroupConfig = null) : ChildCollectionGroupConfigBuilder
45+
```
3146

32-
Adds a child collection group to the current collection with the given name and icon.
47+
#### Example
3348

3449
```csharp
35-
// Example
3650
collectionConfig.AddChildCollectionGroup("Family", "icon-users", childCollectionGroupConfig => {
3751
...
3852
});
Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
description: Configuring child collections in Umbraco UI Builder, the backoffice UI builder for Umbraco.
2+
description: Configuring child collections in Umbraco UI Builder.
33
---
44

55
# Child Collections
@@ -8,40 +8,52 @@ description: Configuring child collections in Umbraco UI Builder, the backoffice
88
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.
99
{% endhint %}
1010

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.
1212

1313
![Child Collections](../images/child_collections.png)
1414

15-
{% hint style="info" %}
16-
**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.
1820

19-
## Defining a child collection
21+
### Using the `AddChildCollection()` Method
2022

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.
2224

23-
### **AddChildCollection<TChildEntityType>(Lambda idFieldExpression, Lambda fkFieldExpression, string nameSingular, string namePlural, string description, Lambda childCollectionConfig = null) : ChildCollectionConfigBuilder<TEntityType>**
25+
#### Method Syntax
26+
27+
```cs
28+
AddChildCollection<TChildEntityType>(Lambda idFieldExpression, Lambda fkFieldExpression, string nameSingular, string namePlural, string description, Lambda childCollectionConfig = null) : ChildCollectionConfigBuilder<TEntityType>
29+
```
2430

25-
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
2632

2733
```csharp
28-
// Example
2934
collectionConfig.AddChildCollection<Child>(c => c.Id, c => c.ParentId, "Child", "Children", "A collection of children", childCollectionConfig => {
3035
...
3136
});
3237
```
3338

34-
### **AddChildCollection&lt;TChildEntityType&gt;(Lambda idFieldExpression, Lambda fkFieldExpression, string nameSingular, string namePlural, string description, string iconSingular, string iconPlural, Lambda childCollectionConfig = null) : ChildCollectionConfigBuilder&lt;TEntityType&gt;**
39+
### 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.
42+
43+
#### Method Syntax
44+
45+
```cs
46+
AddChildCollection<TChildEntityType>(Lambda idFieldExpression, Lambda fkFieldExpression, string nameSingular, string namePlural, string description, string iconSingular, string iconPlural, Lambda childCollectionConfig = null) : ChildCollectionConfigBuilder<TEntityType>
47+
```
3548

36-
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
3750

3851
```csharp
39-
// Example
4052
collectionConfig.AddChildCollection<Child>(c => c.Id, c => c.ParentId, "Child", "Children", "A collection of children", "icon-umb-users", "icon-umb-users", childCollectionConfig => {
4153
...
4254
});
4355
```
4456

45-
## Configuring a child collection
57+
## Configuring a Child Collection
4658

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

Comments
 (0)