Note, the filenames indicate where they should be stored. So Views-Partials-BlockGrid.cshtml
means it should be in Views/Partials/BlockGrid.cshtml
Created
November 6, 2020 09:14
Block List Grid Rendering
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@inherits UmbracoViewPage<BlockListItem<ContentModels.Embed>> | |
@using Umbraco.Core.Models.Blocks | |
@using ContentModels = Umbraco.Web.PublishedModels | |
<div class="video-wrapper"> | |
<iframe width="320" height="240" src="@Model.Content.EmbedUrl" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@inherits UmbracoViewPage<BlockListItem<ContentModels.Headline>> | |
@using Umbraco.Core.Models.Blocks | |
@using ContentModels = Umbraco.Web.PublishedModels | |
<h1>@Model.Content.HeadlineText</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@inherits UmbracoViewPage<BlockListItem<ContentModels.ImageBlock>> | |
@using Umbraco.Core.Models.Blocks | |
@using ContentModels = Umbraco.Web.PublishedModels | |
@if (Model.Content.Image != null) | |
{ | |
<img src="@Model.Content.Image.Url()"> | |
} | |
@if (!Model.Content.Caption.IsNullOrWhiteSpace()) | |
{ | |
<p class="caption">@Model.Content.Caption</p> | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@inherits UmbracoViewPage<BlockListItem<ContentModels.RichTextEditor>> | |
@using Umbraco.Core.Models.Blocks | |
@using ContentModels = Umbraco.Web.PublishedModels | |
@Model.Content.Content |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@inherits UmbracoViewPage<BlockListItem<ContentModels.FullWidthSection>> | |
@using Umbraco.Core.Models.Blocks | |
@using ContentModels = Umbraco.Web.PublishedModels | |
<div class="row"> | |
<div class="col-md-12"> | |
@foreach (var block in Model.Content.MainColumn) | |
{ | |
<div> | |
@Html.Partial("BlockGrid/Blocks/" + block.Content.ContentType.Alias, block, new ViewDataDictionary { { "udis", Model.Content.MainColumn.Select(x => x.ContentUdi) } }) | |
</div> | |
} | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@inherits UmbracoViewPage<BlockListItem<ContentModels.TwoColumnSection>> | |
@using Umbraco.Core.Models.Blocks | |
@using ContentModels = Umbraco.Web.PublishedModels | |
<div class="row"> | |
<div class="col-md-4"> | |
@foreach (var block in Model.Content.AsideColumn) | |
{ | |
@Html.Partial("BlockGrid/Blocks/" + block.Content.ContentType.Alias, block) | |
} | |
</div> | |
<div class="col-md-8"> | |
@foreach (var block in Model.Content.MainColumn) | |
{ | |
@Html.Partial("BlockGrid/Blocks/" + block.Content.ContentType.Alias, block) | |
} | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@inherits UmbracoViewPage<BlockListModel> | |
@using Umbraco.Core.Models.Blocks | |
@if (Model != null) | |
{ | |
<div class="umb-grid"> | |
@foreach (var section in Model) | |
{ | |
@Html.Partial("BlockGrid/Sections/" + section.Content.ContentType.Alias, section) | |
} | |
</div> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment