Multiple Folders in Multiple Media Picker Umbraco 7

832 views Asked by At

I'm trying to add multiple folders in a Multiple Media Picker but when i'm looping through it i'm only getting a single ID.

enter image description here

This is the code i'm using to loop through the content:

 var tabList = Model.Content.GetPropertyValue<string>("containertab").Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse);

Is it allowed to add multiple folders in multiple media picker? How can get the ID of each folder?

1

There are 1 answers

0
Jan Bluemink On BEST ANSWER

It is allowed, try to display the raw field to check you have multiple id's somethings like 1135,1136

@{
<p>@CurrentPage.containertab</p>
}

Simple code example:

@if (!string.IsNullOrEmpty(CurrentPage.containertab))
{
    foreach (var x in CurrentPage.containertab.ToString().Split(','))
    {
        var media = Umbraco.Media(int.Parse(x));

    }
}