@{
var items = Model.Value<IEnumerable<IPublishedElement>>("alias");
foreach(var item in items)
{
var title = item.Value<string>("title");
var description = item.Value<string>("desc");
var image = item.Value<IPublishedContent>("img");
var link = item.Value<IPublishedContent>("link");
@* Si on utilise un content picker, on peux aller chercher les informations de la page liée de cette manière *@
var pageLiee = item.Value<IPublishedContent>("page");
pageLiee.Value("nom");
<div class="item">
@if (image != null)
{
<div><img src="@image.Url" alt="" /></div>
}
@if (!string.IsNullOrEmpty(title))
{
<h2>@title</h2>
}
@if (!string.IsNullOrEmpty(title))
{
<div>@Html.Raw(description)</div>
}
@if (link != null) {
<a class="btn" href="@link.Url">Plus de détails</a>
}
</div>
}
}
@{
var item = Model.Value<IEnumerable<IPublishedElement>>("alias");
var title = item.Value<string>("title");
var description = item.Value<string>("desc");
var image = item.Value<IPublishedContent>("img");
var link = item.Value<IPublishedContent>("link");
<div class="item">
@if (image != null)
{
<div><img src="@image.Url" alt="" /></div>
}
@if (!string.IsNullOrEmpty(title))
{
<h2>@title</h2>
}
@if (!string.IsNullOrEmpty(title))
{
<div>@Html.Raw(description)</div>
}
@if (link != null) {
<a class="btn" href="@link.Url">Plus de détails</a>
}
</div>
}