diff --git a/13/umbraco-cms/fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/media-picker-3.md b/13/umbraco-cms/fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/media-picker-3.md index 494fa66023a..4a456299839 100644 --- a/13/umbraco-cms/fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/media-picker-3.md +++ b/13/umbraco-cms/fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/media-picker-3.md @@ -4,7 +4,10 @@ `Returns: IEnumerable` or `MediaWithCrops` -This property editors returns a single `MediaWithCrops` item if the "Pick multiple items" Data Type setting is disabled or a collection if it is enabled. +This property editors returns one of the following: + +- A collection (`IEnumerable`) if the **Pick multiple items** setting is enabled. +- A single `MediaWithCrops` item if the **Pick multiple items** setting is disabled. ## Data Type Definition Example @@ -71,6 +74,23 @@ Global crops are configured on the Image Cropper property of the Image Media Typ } ``` +#### Multiple enabled without Modelsbuilder to retrieve IEnumerable data + +```csharp +@using Umbraco.Cms.Core.Models +@{ + var listOfImages = Model.Value>("medias"); + foreach (var image in listOfImages) + { + @image.Name + } +} +``` + +{% hint style="info" %} +While `MediaWithCrops` is the default return type, `IPublishedContent` may be used in backward-compatible implementations or when working directly with core APIs. +{% endhint %} + ### Multiple enabled with Modelsbuilder ```csharp diff --git a/14/umbraco-cms/fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/media-picker-3.md b/14/umbraco-cms/fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/media-picker-3.md index 8451e3e7c72..87ee7abe165 100644 --- a/14/umbraco-cms/fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/media-picker-3.md +++ b/14/umbraco-cms/fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/media-picker-3.md @@ -6,7 +6,10 @@ `Returns: IEnumerable` or `MediaWithCrops` -This property editors returns a single `MediaWithCrops` item if the "Pick multiple items" Data Type setting is disabled or a collection if it is enabled. +This property editors returns one of the following: + +- A collection (`IEnumerable`) if the **Pick multiple items** setting is enabled. +- A single `MediaWithCrops` item if the **Pick multiple items** setting is disabled. ## Data Type Definition Example @@ -73,6 +76,23 @@ Global crops are configured on the Image Cropper property of the Image Media Typ } ``` +#### Multiple enabled without Modelsbuilder to retrieve IEnumerable data + +```csharp +@using Umbraco.Cms.Core.Models +@{ + var listOfImages = Model.Value>("medias"); + foreach (var image in listOfImages) + { + @image.Name + } +} +``` + +{% hint style="info" %} +While `MediaWithCrops` is the default return type, `IPublishedContent` may be used in backward-compatible implementations or when working directly with core APIs. +{% endhint %} + ### Multiple enabled with Modelsbuilder ```csharp diff --git a/15/umbraco-cms/fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/media-picker-3.md b/15/umbraco-cms/fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/media-picker-3.md index b9d34510878..a9e95a9d469 100644 --- a/15/umbraco-cms/fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/media-picker-3.md +++ b/15/umbraco-cms/fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/media-picker-3.md @@ -6,7 +6,10 @@ `Returns: IEnumerable` or `MediaWithCrops` -This property editors returns a single `MediaWithCrops` item if the "Pick multiple items" Data Type setting is disabled or a collection if it is enabled. +This property editors returns one of the following: + +- A collection (`IEnumerable`) if the **Pick multiple items** setting is enabled. +- A single `MediaWithCrops` item if the **Pick multiple items** setting is disabled. ## Data Type Definition Example @@ -73,6 +76,23 @@ Global crops are configured on the Image Cropper property of the Image Media Typ } ``` +#### Multiple enabled without Modelsbuilder to retrieve IEnumerable data + +```csharp +@using Umbraco.Cms.Core.Models +@{ + var listOfImages = Model.Value>("medias"); + foreach (var image in listOfImages) + { + @image.Name + } +} +``` + +{% hint style="info" %} +While `MediaWithCrops` is the default return type, `IPublishedContent` may be used in backward-compatible implementations or when working directly with core APIs. +{% endhint %} + ### Multiple enabled with Modelsbuilder ```csharp