Skip to content

Commit 0309558

Browse files
committed
v11.0.0 release update
1 parent 9dd2395 commit 0309558

16 files changed

+41
-38
lines changed

Umbraco.Docs.Samples.Web/CustomIndexing/ProductIndex.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public ProductIndex(
1313
ILoggerFactory loggerFactory,
1414
string name,
1515
IOptionsMonitor<LuceneDirectoryIndexOptions> indexOptions,
16-
IHostingEnvironment hostingEnvironment,
16+
Cms.Core.Hosting.IHostingEnvironment hostingEnvironment,
1717
IRuntimeState runtimeState) : base(loggerFactory,
1818
name,
1919
indexOptions,

Umbraco.Docs.Samples.Web/Umbraco.Docs.Samples.Web.csproj

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
<ItemGroup>
88
<PackageReference Include="NWebsec.AspNetCore.Middleware" Version="3.0.0" />
9-
<PackageReference Include="Umbraco.Cms" Version="11.0.0-rc3" />
10-
<PackageReference Include="Umbraco.TheStarterKit" Version="10.0.0" />
9+
<PackageReference Include="Umbraco.Cms" Version="11.0.0" />
10+
<PackageReference Include="Umbraco.TheStarterKit" Version="11.0.0" />
1111
</ItemGroup>
1212

1313
<!-- Force Windows to use ICU. Otherwise Windows 10 2019H1+ will do it, but older Windows 10 and most, if not all, Windows Server editions will run NLS -->
@@ -58,5 +58,6 @@
5858
<PropertyGroup>
5959
<RazorCompileOnBuild>true</RazorCompileOnBuild>
6060
<RazorCompileOnPublish>true</RazorCompileOnPublish>
61+
<ImplicitUsings>enable</ImplicitUsings>
6162
</PropertyGroup>
6263
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@using Umbraco.Extensions
2+
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridArea>
3+
4+
<div class="umb-block-grid__area"
5+
data-area-col-span="@Model.ColumnSpan"
6+
data-area-row-span="@Model.RowSpan"
7+
data-area-alias="@Model.Alias"
8+
style="--umb-block-grid--grid-columns: @Model.ColumnSpan;--umb-block-grid--area-column-span: @Model.ColumnSpan; --umb-block-grid--area-row-span: @Model.RowSpan;">
9+
@await Html.GetBlockGridItemsHtmlAsync(Model)
10+
</div>

Umbraco.Docs.Samples.Web/Views/Partials/blockgrid/areas.cshtml

+1-7
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@
88
style="--umb-block-grid--area-grid-columns: @(Model.AreaGridColumns?.ToString() ?? Model.GridColumns?.ToString() ?? "12");">
99
@foreach (var area in Model.Areas)
1010
{
11-
<div class="umb-block-grid__area"
12-
data-area-col-span="@area.ColumnSpan"
13-
data-area-row-span="@area.RowSpan"
14-
data-area-alias="@area.Alias"
15-
style="--umb-block-grid--grid-columns: @area.ColumnSpan;--umb-block-grid--area-column-span: @area.ColumnSpan; --umb-block-grid--area-row-span: @area.RowSpan;">
16-
@await Html.GetBlockGridItemsHtmlAsync(area)
17-
</div>
11+
@await Html.GetBlockGridItemAreaHtmlAsync(area)
1812
}
1913
</div>

Umbraco.Docs.Samples.Web/Views/Partials/blockgrid/items.cshtml

+1-4
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,14 @@
77
<div class="umb-block-grid__layout-container">
88
@foreach (var item in Model)
99
{
10-
bool attrForceLeft = item.ForceLeft;
11-
bool attrForceRight = item.ForceRight;
10+
1211
<div
1312
class="umb-block-grid__layout-item"
1413
data-content-element-type-alias="@item.Content.ContentType.Alias"
1514
data-content-element-type-key="@item.Content.ContentType.Key"
1615
data-element-udi="@item.ContentUdi"
1716
data-col-span="@item.ColumnSpan"
1817
data-row-span="@item.RowSpan"
19-
@(attrForceLeft ? "data-force-left" : null)
20-
@(attrForceRight ? "data-force-right" : null)
2118
style=" --umb-block-grid--item-column-span: @item.ColumnSpan; --umb-block-grid--item-row-span: @item.RowSpan; ">
2219
@{
2320
var partialViewName = "blockgrid/Components/" + item.Content.ContentType.Alias;
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockListModel>
22
@{
3-
if (!Model.Any()) { return; }
3+
if (Model?.Any() != true) { return; }
44
}
55
<div class="umb-block-list">
66
@foreach (var block in Model)
77
{
88
if (block?.ContentUdi == null) { continue; }
99
var data = block.Content;
1010

11-
@await Html.PartialAsync("BlockList/Components/" + data.ContentType.Alias, block)
11+
@await Html.PartialAsync("blocklist/Components/" + data.ContentType.Alias, block)
1212
}
1313
</div>

Umbraco.Docs.Samples.Web/Views/Partials/grid/bootstrap3-fluid.cshtml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Razor helpers located at the bottom of this file
88
*@
99

10-
@if (Model != null && Model.GetType() == typeof(JObject) && Model.sections != null)
10+
@if (Model is JObject && Model?.sections is not null)
1111
{
1212
var oneColumn = ((System.Collections.ICollection)Model.sections).Count == 1;
1313

@@ -55,7 +55,7 @@
5555
<div @RenderElementAttributes(area)>
5656
@foreach (var control in area.controls)
5757
{
58-
if (control != null && control.editor != null && control.editor.view != null)
58+
if (control?.editor?.view != null)
5959
{
6060
<text>@await Html.PartialAsync("grid/editors/base", (object)control)</text>
6161
}

Umbraco.Docs.Samples.Web/Views/Partials/grid/bootstrap3.cshtml

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
@using Newtonsoft.Json.Linq
44
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<dynamic>
55

6-
@if (Model != null && Model.GetType() == typeof(JObject) && Model.sections != null)
6+
@if (Model is JObject && Model?.sections is not null)
77
{
8-
var oneColumn = ((System.Collections.ICollection)Model.sections).Count == 1;
8+
var oneColumn = ((System.Collections.ICollection)Model.sections).Count == 1;
99

1010
<div class="umb-grid">
1111
@if (oneColumn)
@@ -56,7 +56,7 @@
5656
<div @RenderElementAttributes(area)>
5757
@foreach (var control in area.controls)
5858
{
59-
if (control != null && control.editor != null && control.editor.view != null)
59+
if (control?.editor?.view != null)
6060
{
6161
<text>@await Html.PartialAsync("grid/editors/base", (object)control)</text>
6262
}

Umbraco.Docs.Samples.Web/Views/Partials/grid/editors/base.cshtml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
@try
44
{
55
string editor = EditorView(Model);
6-
<text>@await Html.PartialAsync(editor, (object)Model)</text>
6+
<text>@await Html.PartialAsync(editor, Model as object)</text>
77
}
88
catch (Exception ex)
99
{
@@ -15,7 +15,7 @@ catch (Exception ex)
1515
public static string EditorView(dynamic contentItem)
1616
{
1717
string view = contentItem.editor.render != null ? contentItem.editor.render.ToString() : contentItem.editor.view.ToString();
18-
view = view.ToLower().Replace(".html", ".cshtml");
18+
view = view.Replace(".html", ".cshtml");
1919

2020
if (!view.Contains("/"))
2121
{
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<dynamic>
1+
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<dynamic>
22

3-
@{
4-
string embedValue = Convert.ToString(Model.value);
5-
embedValue = embedValue.DetectIsJson() ? Model.value.preview : Model.value;
6-
}
3+
@if (Model is not null)
4+
{
5+
string embedValue = Convert.ToString(Model.value);
6+
embedValue = embedValue.DetectIsJson() ? Model.value.preview : Model.value;
77

8-
<div class="video-wrapper">
9-
@Html.Raw(embedValue)
10-
</div>
8+
<div class="video-wrapper">
9+
@Html.Raw(embedValue)
10+
</div>
11+
}

Umbraco.Docs.Samples.Web/Views/Partials/grid/editors/macro.cshtml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<dynamic>
22

3-
@if (Model.value != null)
3+
@if (Model?.value is not null)
44
{
55
string macroAlias = Model.value.macroAlias.ToString();
66
var parameters = new Dictionary<string,object>();

Umbraco.Docs.Samples.Web/Views/Partials/grid/editors/media.cshtml

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
@using Umbraco.Cms.Core.Media
33
@using Umbraco.Cms.Core.PropertyEditors.ValueConverters
44
@inject IImageUrlGenerator ImageUrlGenerator
5-
@if (Model.value != null)
5+
6+
@if (Model?.value is not null)
67
{
78
var url = Model.value.image;
89

Umbraco.Docs.Samples.Web/Views/Partials/grid/editors/rte.cshtml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
@inject HtmlImageSourceParser HtmlImageSourceParser;
66

77
@{
8-
var value = HtmlLocalLinkParser.EnsureInternalLinks(Model.value.ToString());
8+
var value = HtmlLocalLinkParser.EnsureInternalLinks(Model?.value.ToString());
99
value = HtmlUrlParser.EnsureUrls(value);
1010
value = HtmlImageSourceParser.EnsureImageSources(value);
1111
}

Umbraco.Docs.Samples.Web/Views/Partials/grid/editors/textstring.cshtml

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
@using System.Web
21
@model dynamic
32

4-
@if (Model.editor.config.markup != null)
3+
@if (Model?.editor.config.markup is not null)
54
{
65
string markup = Model.editor.config.markup.ToString();
7-
markup = markup.Replace("#value#", Html.ReplaceLineBreaks(HttpUtility.HtmlEncode((string)Model.value.ToString())).ToString());
6+
markup = markup.Replace("#value#", Html.ReplaceLineBreaks((string)Model.value.ToString()).ToString());
87

98
if (Model.editor.config.style != null)
109
{
@@ -18,6 +17,6 @@
1817
else
1918
{
2019
<text>
21-
<div style="@Model.editor.config.style">@Model.value</div>
20+
<div style="@Model?.editor.config.style">@Model?.value</div>
2221
</text>
2322
}
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)