Just parsing layout as model for partial views.
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
@inherits UmbracoViewPage<BlockListModel>
|
||||
@using ContentModels = Umbraco.Web.PublishedModels;
|
||||
@using Umbraco.Core.Models.Blocks
|
||||
@{
|
||||
if (Model?.Layout == null || !Model.Layout.Any()) { return; }
|
||||
}
|
||||
<div class="umb-block-list">
|
||||
@foreach (var layout in Model.Layout)
|
||||
{
|
||||
if (layout?.Udi == null) { continue; }
|
||||
var data = layout.Data;
|
||||
@Html.Partial("BlockList/" + data.ContentType.Alias, (data, layout.Settings))
|
||||
}
|
||||
</div>
|
||||
@inherits UmbracoViewPage<BlockListModel>
|
||||
@using ContentModels = Umbraco.Web.PublishedModels;
|
||||
@using Umbraco.Core.Models.Blocks
|
||||
@{
|
||||
if (Model?.Layout == null || !Model.Layout.Any()) { return; }
|
||||
}
|
||||
<div class="umb-block-list">
|
||||
@foreach (var layout in Model.Layout)
|
||||
{
|
||||
if (layout?.Udi == null) { continue; }
|
||||
var data = layout.Data;
|
||||
@Html.Partial("BlockList/" + data.ContentType.Alias, layout)
|
||||
}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user