From fe76ead206d39cbbcf187f7abe94483528674f13 Mon Sep 17 00:00:00 2001 From: Kevin Date: Mon, 28 Apr 2025 11:43:08 -0500 Subject: [PATCH 1/5] Update understand-and-extend.md Reworded inheritance logic to reflect the logic being removed in v14. --- .../templating/modelsbuilder/understand-and-extend.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/15/umbraco-cms/reference/templating/modelsbuilder/understand-and-extend.md b/15/umbraco-cms/reference/templating/modelsbuilder/understand-and-extend.md index c3d7b89d21e..f562c8a5fc6 100644 --- a/15/umbraco-cms/reference/templating/modelsbuilder/understand-and-extend.md +++ b/15/umbraco-cms/reference/templating/modelsbuilder/understand-and-extend.md @@ -110,9 +110,13 @@ public partial class TextPage : PublishedContentModel, IMetaInfo ### Inheritance -In addition to composition, content types can have a parent-child relationship. In the Umbraco backoffice, a content type appears underneath its parent. +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. -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. +{% hint style="info" %} +The option to add child content types in the backoffice was removed in v14, but migrated sites may still have content types with this relationship. New content types can inherit through Composition. +{% endhint %} + +This type of inheritance is treated differently since the content type is always **composed of its parent**, so the child content type *directly inherits* (as in C# inheritance) from the parent class. If `AboutPage` is a child of TextPage, its generated model would inherit directly from `TextPage`: From 2266c1befab127ad7a48064ea7ac4a8a4c94ec88 Mon Sep 17 00:00:00 2001 From: sofietoft Date: Tue, 29 Apr 2025 08:25:57 +0200 Subject: [PATCH 2/5] Update understand-and-extend.md --- .../reference/templating/modelsbuilder/understand-and-extend.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/15/umbraco-cms/reference/templating/modelsbuilder/understand-and-extend.md b/15/umbraco-cms/reference/templating/modelsbuilder/understand-and-extend.md index f562c8a5fc6..db8b053212d 100644 --- a/15/umbraco-cms/reference/templating/modelsbuilder/understand-and-extend.md +++ b/15/umbraco-cms/reference/templating/modelsbuilder/understand-and-extend.md @@ -113,7 +113,7 @@ public partial class TextPage : PublishedContentModel, IMetaInfo 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. {% hint style="info" %} -The option to add child content types in the backoffice was removed in v14, but migrated sites may still have content types with this relationship. New content types can inherit through Composition. +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. {% endhint %} This type of inheritance is treated differently since the content type is always **composed of its parent**, so the child content type *directly inherits* (as in C# inheritance) from the parent class. From ad9097966ce90954c5876a77f254e99e352e1291 Mon Sep 17 00:00:00 2001 From: sofietoft Date: Tue, 29 Apr 2025 08:26:56 +0200 Subject: [PATCH 3/5] Update understand-and-extend.md --- .../reference/templating/modelsbuilder/understand-and-extend.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/15/umbraco-cms/reference/templating/modelsbuilder/understand-and-extend.md b/15/umbraco-cms/reference/templating/modelsbuilder/understand-and-extend.md index db8b053212d..5779e583b67 100644 --- a/15/umbraco-cms/reference/templating/modelsbuilder/understand-and-extend.md +++ b/15/umbraco-cms/reference/templating/modelsbuilder/understand-and-extend.md @@ -116,7 +116,7 @@ In addition to composition, earlier versions of Umbraco allowed content types to 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. {% endhint %} -This type of inheritance is treated differently since the content type is always **composed of its parent**, so the child content type *directly inherits* (as in C# inheritance) from the parent class. +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. If `AboutPage` is a child of TextPage, its generated model would inherit directly from `TextPage`: From a7391429d32f30b98db802db3dea720993dabecc Mon Sep 17 00:00:00 2001 From: sofietoft Date: Tue, 29 Apr 2025 09:54:10 +0200 Subject: [PATCH 4/5] Trigger GitBook Checks --- .../reference/templating/modelsbuilder/understand-and-extend.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/15/umbraco-cms/reference/templating/modelsbuilder/understand-and-extend.md b/15/umbraco-cms/reference/templating/modelsbuilder/understand-and-extend.md index 5779e583b67..011923498a9 100644 --- a/15/umbraco-cms/reference/templating/modelsbuilder/understand-and-extend.md +++ b/15/umbraco-cms/reference/templating/modelsbuilder/understand-and-extend.md @@ -51,7 +51,7 @@ public partial class TextPage : PublishedContentModel In the above code: * The model includes a constructor and static helpers to fetch the content type (`PublishedContentType`) and property type (`PublishedPropertyType`). -* The most important part is the property definition (`Header`), which retrieve values from Umbraco. +* The most important part is the property definition (`Header`), which retrieves values from Umbraco. You can use helper methods to access content and property types: From 773b3972845d1bde41a01bf04e0f03cc17645421 Mon Sep 17 00:00:00 2001 From: sofietoft Date: Tue, 29 Apr 2025 09:59:58 +0200 Subject: [PATCH 5/5] Trigger GitBook Checks --- .../reference/templating/modelsbuilder/understand-and-extend.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/15/umbraco-cms/reference/templating/modelsbuilder/understand-and-extend.md b/15/umbraco-cms/reference/templating/modelsbuilder/understand-and-extend.md index 011923498a9..018e2d6f5d1 100644 --- a/15/umbraco-cms/reference/templating/modelsbuilder/understand-and-extend.md +++ b/15/umbraco-cms/reference/templating/modelsbuilder/understand-and-extend.md @@ -149,7 +149,7 @@ For more complex customizations, use the full version of [Models Builder](https: ### Custom Model Generation with IModelsGenerator -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: +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: The interface can be accessed via `Infrastructure.ModelsBuilder.Building.ModelsGenerator`.