Afficher les images d'un dossier
Attention: Vous devez activer le setting "Multiple items"
@{
foreach (var childItem in Model.Value<IEnumerable<IPublishedContent>>("alias"))
{
var media = Umbraco.Media(@childItem.Id);
var selection = media.Children();
foreach(var item in selection){
<img src="@item.Url" alt="" />;
}
}
}
Afficher les images choisies (multiple items)
Attention: Vous devez activer le setting "Image uniquement"
@{
var typedMultiMediaPicker = Model.Value<IEnumerable<IPublishedContent>>("alias");
foreach (var item in typedMultiMediaPicker)
{
<img src="@item.Url" alt="@item.Value("alternateText")" />
}
}
Afficher l'image choisie (single item)
@{
var item = Model.Value<IPublishedContent>("alias");
<img src="@item.Url" alt="@item.Value("alternateText")" />
}