Reputation: 1831
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.
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?
Upvotes: 1
Views: 838
Reputation: 3487
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));
}
}
Upvotes: 1