Skip to content

Commit 37875cf

Browse files
authored
Merge pull request #7046 from kmeilander/patch-8
Update understand-and-extend.md
2 parents 3bf91f5 + 773b397 commit 37875cf

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

15/umbraco-cms/reference/templating/modelsbuilder/understand-and-extend.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public partial class TextPage : PublishedContentModel
5151
In the above code:
5252

5353
* The model includes a constructor and static helpers to fetch the content type (`PublishedContentType`) and property type (`PublishedPropertyType`).
54-
* The most important part is the property definition (`Header`), which retrieve values from Umbraco.
54+
* The most important part is the property definition (`Header`), which retrieves values from Umbraco.
5555

5656
You can use helper methods to access content and property types:
5757

@@ -110,9 +110,13 @@ public partial class TextPage : PublishedContentModel, IMetaInfo
110110

111111
### Inheritance
112112

113-
In addition to composition, content types can have a parent-child relationship. In the Umbraco backoffice, a content type appears underneath its parent.
113+
In addition to composition, earlier versions of Umbraco allowed content types to have a parent-child relationship. In the Umbraco backoffice, a content type appears underneath its parent.
114114

115-
By convention, a content type is always **composed of its parent** and therefore inherits its properties. However, the parent content type is treated differently, and the child content type *directly inherits* (as in C# inheritance) from the parent class.
115+
{% hint style="info" %}
116+
The option to add child content types in the backoffice was removed in v14. Migrated sites may still have the child content types set up. New content types can be inherited through Composition.
117+
{% endhint %}
118+
119+
This type of inheritance is treated differently since the content type is always **composed of its parent**. The child content type *inherits directly* (as in C# inheritance) from the parent class.
116120

117121
If `AboutPage` is a child of TextPage, its generated model would inherit directly from `TextPage`:
118122

@@ -145,7 +149,7 @@ For more complex customizations, use the full version of [Models Builder](https:
145149

146150
### Custom Model Generation with IModelsGenerator
147151

148-
From Umbraco 11.4, you can implement the `IModelsGenerator` interface hto customize how models are generated. This allows you to replace Umbraco’s default implementation using dependency injection:
152+
From Umbraco 11.4, you can implement the `IModelsGenerator` interface to customize how models are generated. This allows you to replace Umbraco’s default implementation using dependency injection:
149153

150154
The interface can be accessed via `Infrastructure.ModelsBuilder.Building.ModelsGenerator`.
151155

0 commit comments

Comments
 (0)