-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move block grid single area rendering to its own dedicated view (#13359)
- Loading branch information
Showing
7 changed files
with
81 additions
and
16 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@using Umbraco.Extensions | ||
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridArea> | ||
|
||
<div class="umb-block-grid__area" | ||
data-area-col-span="@Model.ColumnSpan" | ||
data-area-row-span="@Model.RowSpan" | ||
data-area-alias="@Model.Alias" | ||
style="--umb-block-grid--grid-columns: @Model.ColumnSpan;--umb-block-grid--area-column-span: @Model.ColumnSpan; --umb-block-grid--area-row-span: @Model.RowSpan;"> | ||
@await Html.GetBlockGridItemsHtmlAsync(Model) | ||
</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
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
29 changes: 29 additions & 0 deletions
29
src/Umbraco.Infrastructure/Migrations/Upgrade/V_10_4_0/AddBlockGridPartialViews.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using Umbraco.Cms.Infrastructure.Templates.PartialViews; | ||
|
||
namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_10_4_0; | ||
|
||
public class AddBlockGridPartialViews : MigrationBase | ||
{ | ||
private readonly IPartialViewPopulator _partialViewPopulator; | ||
private const string FolderPath = "/Views/Partials/blockgrid"; | ||
private static readonly string[] _filesToAdd = | ||
{ | ||
"area.cshtml", | ||
}; | ||
|
||
public AddBlockGridPartialViews(IMigrationContext context, IPartialViewPopulator partialViewPopulator) : base(context) | ||
=> _partialViewPopulator = partialViewPopulator; | ||
|
||
protected override void Migrate() | ||
{ | ||
var embeddedBasePath = _partialViewPopulator.CoreEmbeddedPath + ".BlockGrid"; | ||
|
||
foreach (var fileName in _filesToAdd) | ||
{ | ||
_partialViewPopulator.CopyPartialViewIfNotExists( | ||
_partialViewPopulator.GetCoreAssembly(), | ||
$"{embeddedBasePath}.{fileName}", | ||
$"{FolderPath}/{fileName}"); | ||
} | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@using Umbraco.Extensions | ||
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridArea> | ||
|
||
<div class="umb-block-grid__area" | ||
data-area-col-span="@Model.ColumnSpan" | ||
data-area-row-span="@Model.RowSpan" | ||
data-area-alias="@Model.Alias" | ||
style="--umb-block-grid--grid-columns: @Model.ColumnSpan;--umb-block-grid--area-column-span: @Model.ColumnSpan; --umb-block-grid--area-row-span: @Model.RowSpan;"> | ||
@await Html.GetBlockGridItemsHtmlAsync(Model) | ||
</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