From 3841467cd732bbe73ae8963e9e1edc866e30a1a3 Mon Sep 17 00:00:00 2001 From: Andy Butland Date: Thu, 20 Mar 2025 10:58:56 +0100 Subject: [PATCH] Fixed reference to typed value when rendering rich text property values. --- .../fundamentals/design/rendering-content.md | 11 ++++++++--- .../fundamentals/design/rendering-content.md | 10 +++++++--- .../fundamentals/design/rendering-content.md | 10 +++++++--- .../fundamentals/design/rendering-content.md | 10 +++++++--- 4 files changed, 29 insertions(+), 12 deletions(-) diff --git a/10/umbraco-cms/fundamentals/design/rendering-content.md b/10/umbraco-cms/fundamentals/design/rendering-content.md index 5855d9b841a..ef3485a3bb8 100644 --- a/10/umbraco-cms/fundamentals/design/rendering-content.md +++ b/10/umbraco-cms/fundamentals/design/rendering-content.md @@ -19,16 +19,21 @@ Each property in your [Document Type](../data/defining-content/#what-is-a-docume ### Specifying types of data -You can specify the type of data being returned to help you format the value for display, consider the publish date in our example: +You can specify the type of data being returned to help you format the value for display. -To use the `` as the data return type, add the `@using Microsoft.AspNetCore.Html;` directive. +In our example, we have a string, a date and some rich text: ```html

@(Model.Value("pageTitle"))

-
@(Model.Value("bodyContent"))
+
@(Model.Value("bodyContent"))

Article date:

``` +{% hint style="info" %} +To use `IHtmlEncodedString` as the typed value, add the `@using Umbraco.Cms.Core.Strings;` directive. +{% endhint %} + + ### Using ModelsBuilder ```html diff --git a/13/umbraco-cms/fundamentals/design/rendering-content.md b/13/umbraco-cms/fundamentals/design/rendering-content.md index 752f41c341f..e8af49920d9 100644 --- a/13/umbraco-cms/fundamentals/design/rendering-content.md +++ b/13/umbraco-cms/fundamentals/design/rendering-content.md @@ -14,16 +14,20 @@ Each property in your [Document Type](../data/defining-content/#what-is-a-docume ### Specifying types of data -You can specify the type of data being returned to help you format the value for display, consider the publish date in our example: +You can specify the type of data being returned to help you format the value for display. -To use the `` as the data return type, add the `@using Microsoft.AspNetCore.Html;` directive. +In our example, we have a string, a date and some rich text: ```html

@(Model.Value("pageTitle"))

-
@(Model.Value("bodyContent"))
+
@(Model.Value("bodyContent"))

Article date:

``` +{% hint style="info" %} +To use `IHtmlEncodedString` as the typed value, add the `@using Umbraco.Cms.Core.Strings;` directive. +{% endhint %} + ### Using ModelsBuilder ```html diff --git a/14/umbraco-cms/fundamentals/design/rendering-content.md b/14/umbraco-cms/fundamentals/design/rendering-content.md index 4b5f8cdc29c..c76382ca502 100644 --- a/14/umbraco-cms/fundamentals/design/rendering-content.md +++ b/14/umbraco-cms/fundamentals/design/rendering-content.md @@ -14,16 +14,20 @@ Each property in your [Document Type](../data/defining-content/#what-is-a-docume ### Specifying types of data -You can specify the type of data being returned to help you format the value for display, consider the publish date in our example: +You can specify the type of data being returned to help you format the value for display. -To use the `` as the data return type, add the `@using Microsoft.AspNetCore.Html;` directive. +In our example, we have a string, a date and some rich text: ```html

@(Model.Value("pageTitle"))

-
@(Model.Value("bodyContent"))
+
@(Model.Value("bodyContent"))

Article date:

``` +{% hint style="info" %} +To use `IHtmlEncodedString` as the typed value, add the `@using Umbraco.Cms.Core.Strings;` directive. +{% endhint %} + ### Using ModelsBuilder ```html diff --git a/15/umbraco-cms/fundamentals/design/rendering-content.md b/15/umbraco-cms/fundamentals/design/rendering-content.md index 4b5f8cdc29c..c76382ca502 100644 --- a/15/umbraco-cms/fundamentals/design/rendering-content.md +++ b/15/umbraco-cms/fundamentals/design/rendering-content.md @@ -14,16 +14,20 @@ Each property in your [Document Type](../data/defining-content/#what-is-a-docume ### Specifying types of data -You can specify the type of data being returned to help you format the value for display, consider the publish date in our example: +You can specify the type of data being returned to help you format the value for display. -To use the `` as the data return type, add the `@using Microsoft.AspNetCore.Html;` directive. +In our example, we have a string, a date and some rich text: ```html

@(Model.Value("pageTitle"))

-
@(Model.Value("bodyContent"))
+
@(Model.Value("bodyContent"))

Article date:

``` +{% hint style="info" %} +To use `IHtmlEncodedString` as the typed value, add the `@using Umbraco.Cms.Core.Strings;` directive. +{% endhint %} + ### Using ModelsBuilder ```html