Skip to content

Commit a4429a5

Browse files
Merge pull request #90 from rickbutterfield/v1/1.12.0
V1/1.12.0
2 parents 6a9d949 + 4970e43 commit a4429a5

71 files changed

Lines changed: 2086 additions & 67646 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,19 @@ The Umbraco 10.4+ version of this package is [available via NuGet](https://www.n
2323
To install the package, you can use either .NET CLI:
2424

2525
```
26-
dotnet add package Umbraco.Community.BlockPreview --version 1.11.0
26+
dotnet add package Umbraco.Community.BlockPreview --version 1.12.0
2727
```
2828

2929
or the older NuGet Package Manager:
3030

3131
```
32-
Install-Package Umbraco.Community.BlockPreview -Version 1.11.0
32+
Install-Package Umbraco.Community.BlockPreview -Version 1.12.0
3333
```
3434

3535
### Setup
36-
`Umbraco:Cms:ModelsBuilder:ModelsBuilderMode` **must** be set to either `SourceCodeAuto` or `SourceCodeManual` for BlockPreview to work.
36+
Generated strongly typed models must exist on disk for BlockPreview to work. `Umbraco:Cms:ModelsBuilder:ModelsMode` **must** be set to either `SourceCodeAuto` or `SourceCodeManual` in your development environment and generated files committed to disk before deploying.
3737

38+
If you are using [Limbo.Umbraco.ModelsBuilder](https://github.com/limbo-works/Limbo.Umbraco.ModelsBuilder), the default configuration is to have `ModelsMode` set to nothing. Once this is set, generate models in the backoffice as normal.
3839
```json
3940
"Umbraco": {
4041
"CMS": {

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.11.0
1+
1.12.0

src/Umbraco.Cms.13.x/Umbraco.Cms.13.x.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
</ItemGroup>
1717

1818
<ItemGroup>
19+
<PackageReference Include="Limbo.Umbraco.ModelsBuilder" Version="13.0.2" />
1920
<PackageReference Include="Umbraco.BlockGrid.Example.Website" Version="1.0.2" />
2021
<PackageReference Include="Umbraco.Cms" Version="13.5.2" />
2122
<PackageReference Include="uSync" Version="13.0.0" />
@@ -28,6 +29,10 @@
2829
<RuntimeHostConfigurationOption Include="System.Globalization.AppLocalIcu" Value="68.2.0.9" Condition="$(RuntimeIdentifier.StartsWith('linux')) or $(RuntimeIdentifier.StartsWith('win')) or ('$(RuntimeIdentifier)' == '' and !$([MSBuild]::IsOSPlatform('osx')))" />
2930
</ItemGroup>
3031

32+
<ItemGroup>
33+
<Folder Include="umbraco\" />
34+
</ItemGroup>
35+
3136
<PropertyGroup>
3237
<!-- Razor files are needed for the backoffice to work correctly -->
3338
<CopyRazorGenerateFilesToPublishDirectory>true</CopyRazorGenerateFilesToPublishDirectory>

src/Umbraco.Cms.13.x/Views/BlockGrid.cshtml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<ContentModels.BlockGrid>
2-
@using ContentModels = Umbraco.Cms.Web.Common.PublishedModels;
1+
@inherits UmbracoViewPage<BlockGrid>
32
@{
43
Layout = "Layout.cshtml";
54
}

src/Umbraco.Cms.13.x/Views/Partials/blockgrid/Components/heroBlock.cshtml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridItem<HeroBlock>>
1+
@inherits UmbracoViewPage<BlockGridItem<HeroBlock>>
22
@{
3-
var backgroundColor = Model.Content.BackgroundColor;
4-
var image = Model.Content.Image;
5-
var hasBrightContrast = Model.Content.Contrast == "ffffff";
3+
var backgroundColor = Model.Content.Value<string>("backgroundColor");
4+
var image = Model.Content.Value<IPublishedContent>("image");
5+
var hasBrightContrast = Model.Content.Value<string>("contrast") == "ffffff";
66
}
77

8+
<pre>Content Picker: @Model.Content.ContentPicker?.Name (@Model.Content.ContentPicker?.Url())</pre>
9+
<pre>Dropdown: @Model.Content.Dropdown</pre>
10+
811
<div
912
class="hero"
1013
style="background-color:#@backgroundColor"
@@ -14,9 +17,10 @@
1417
<div class="hero-background" style="background-image: url(@image.GetCropUrl(width:3840))">
1518
</div>
1619
}
20+
1721

1822
<div class="hero-content">
19-
<h1>@Model.Content.Headline</h1>
23+
<h1>@(Model.Content.Value<string>("headline"))</h1>
2024
@* Only render if there is some content... *@
2125
@if (Model.Areas.Any(a => a.Any())) {
2226
@await Html.GetPreviewBlockGridItemAreasHtmlAsync(Model)

src/Umbraco.Cms.13.x/Views/Partials/blockgrid/Components/oneColumnSectionBlock.cshtml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,9 @@
1111
@(noBackgroundColor ? "nobackgroundcolor" : null)
1212
@(hasBrightContrast ? "bright-contrast" : null)>
1313
@await Html.GetPreviewBlockGridItemAreasHtmlAsync(Model)
14+
15+
@if (Model.Content.BlockGrid != null)
16+
{
17+
@await Html.GetPreviewBlockGridItemsHtmlAsync(Model.Content.BlockGrid)
18+
}
1419
</section>

src/Umbraco.Cms.13.x/Views/_ViewImports.cshtml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
@using Umbraco.Extensions
22
@using Umbraco.Cms._13.x
33
@using Umbraco.Cms.Web.Common.PublishedModels
4+
@using Umbraco.Cms.Web.Common.PublishedModels.Content
5+
@using Umbraco.Cms.Web.Common.PublishedModels.Elements
46
@using Umbraco.Cms.Web.Common.Views
57
@using Umbraco.Cms.Core.Models.PublishedContent
68
@using Umbraco.Cms.Core.Models.Blocks

src/Umbraco.Cms.13.x/appsettings.Development.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"Debug": true
3838
},
3939
"ModelsBuilder": {
40-
"ModelsMode": "SourceCodeAuto"
40+
"ModelsMode": "Nothing"
4141
},
4242
"RuntimeMinification": {
4343
"UseInMemoryCache": true,

src/Umbraco.Cms.13.x/uSync/v9/Content/home.config

Lines changed: 22 additions & 85 deletions
Large diffs are not rendered by default.
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Content Key="f7a52fdf-1a72-44d2-bf0a-0a73379c9497" Alias="Nested Test" Level="2">
3+
<Info>
4+
<Parent Key="6e2ff1f7-114e-484b-a407-918daded1aa6">Home</Parent>
5+
<Path>/Home/NestedTest</Path>
6+
<Trashed>false</Trashed>
7+
<ContentType>blockGrid</ContentType>
8+
<CreateDate>2025-01-22T16:49:04</CreateDate>
9+
<NodeName Default="Nested Test" />
10+
<SortOrder>4</SortOrder>
11+
<Published Default="true" />
12+
<Schedule />
13+
<Template Key="bce3dfc2-5152-427f-999b-0f0901548bdc">BlockGrid</Template>
14+
</Info>
15+
<Properties>
16+
<content>
17+
<Value><![CDATA[{
18+
"layout": {
19+
"Umbraco.BlockGrid": [
20+
{
21+
"contentUdi": "umb://element/66b9ef01d4fa402e91f36fbafc97778d",
22+
"settingsUdi": "umb://element/e7fd8d82f7ce48af8473ab38be7efff1",
23+
"areas": [
24+
{
25+
"key": "9f1c62ff-38ec-4488-bdc4-b39edfd425f3",
26+
"items": []
27+
}
28+
],
29+
"columnSpan": 12,
30+
"rowSpan": 1
31+
}
32+
]
33+
},
34+
"contentData": [
35+
{
36+
"contentTypeKey": "964feee4-efb3-4676-91a0-b960f26e9d92",
37+
"udi": "umb://element/66b9ef01d4fa402e91f36fbafc97778d",
38+
"blockGrid": {
39+
"layout": {
40+
"Umbraco.BlockGrid": [
41+
{
42+
"contentUdi": "umb://element/ddc1e7646f82442e9f7a4d3ff8049bbc",
43+
"areas": [
44+
{
45+
"key": "3b490f17-1471-4ac4-9434-60e676639e29",
46+
"items": []
47+
}
48+
],
49+
"columnSpan": 12,
50+
"rowSpan": 1
51+
}
52+
]
53+
},
54+
"contentData": [
55+
{
56+
"contentTypeKey": "432b58a8-01b7-47dc-8664-f72bf1045f66",
57+
"udi": "umb://element/ddc1e7646f82442e9f7a4d3ff8049bbc",
58+
"headline": "Testing",
59+
"image": [],
60+
"backgroundColor": "",
61+
"contrast": "",
62+
"contentPicker": "umb://document/6e2ff1f7114e484ba407918daded1aa6",
63+
"dropdown": [
64+
"1"
65+
]
66+
}
67+
],
68+
"settingsData": []
69+
}
70+
}
71+
],
72+
"settingsData": [
73+
{
74+
"contentTypeKey": "1a16c578-dacc-4552-ad07-26553c8a34fd",
75+
"udi": "umb://element/e7fd8d82f7ce48af8473ab38be7efff1",
76+
"backgroundColor": "",
77+
"contrast": ""
78+
}
79+
]
80+
}]]></Value>
81+
</content>
82+
</Properties>
83+
</Content>

0 commit comments

Comments
 (0)