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
Copy file name to clipboardExpand all lines: 15/umbraco-cms/reference/templating/modelsbuilder/understand-and-extend.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,7 @@ public partial class TextPage : PublishedContentModel
51
51
In the above code:
52
52
53
53
* 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.
55
55
56
56
You can use helper methods to access content and property types:
57
57
@@ -110,9 +110,13 @@ public partial class TextPage : PublishedContentModel, IMetaInfo
110
110
111
111
### Inheritance
112
112
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.
114
114
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.
116
120
117
121
If `AboutPage` is a child of TextPage, its generated model would inherit directly from `TextPage`:
118
122
@@ -145,7 +149,7 @@ For more complex customizations, use the full version of [Models Builder](https:
145
149
146
150
### Custom Model Generation with IModelsGenerator
147
151
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:
149
153
150
154
The interface can be accessed via `Infrastructure.ModelsBuilder.Building.ModelsGenerator`.
0 commit comments