Skip to content

Commit

Permalink
Merge pull request #90 from rickbutterfield/v1/1.12.0
Browse files Browse the repository at this point in the history
V1/1.12.0
rickbutterfield authored Jan 24, 2025
2 parents 6a9d949 + 4970e43 commit a4429a5
Showing 71 changed files with 2,086 additions and 67,646 deletions.
7 changes: 4 additions & 3 deletions .github/README.md
Original file line number Diff line number Diff line change
@@ -23,18 +23,19 @@ The Umbraco 10.4+ version of this package is [available via NuGet](https://www.n
To install the package, you can use either .NET CLI:

```
dotnet add package Umbraco.Community.BlockPreview --version 1.11.0
dotnet add package Umbraco.Community.BlockPreview --version 1.12.0
```

or the older NuGet Package Manager:

```
Install-Package Umbraco.Community.BlockPreview -Version 1.11.0
Install-Package Umbraco.Community.BlockPreview -Version 1.12.0
```

### Setup
`Umbraco:Cms:ModelsBuilder:ModelsBuilderMode` **must** be set to either `SourceCodeAuto` or `SourceCodeManual` for BlockPreview to work.
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.

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.
```json
"Umbraco": {
"CMS": {
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.11.0
1.12.0
5 changes: 5 additions & 0 deletions src/Umbraco.Cms.13.x/Umbraco.Cms.13.x.csproj
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@
</ItemGroup>

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

<ItemGroup>
<Folder Include="umbraco\" />
</ItemGroup>

<PropertyGroup>
<!-- Razor files are needed for the backoffice to work correctly -->
<CopyRazorGenerateFilesToPublishDirectory>true</CopyRazorGenerateFilesToPublishDirectory>
3 changes: 1 addition & 2 deletions src/Umbraco.Cms.13.x/Views/BlockGrid.cshtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<ContentModels.BlockGrid>
@using ContentModels = Umbraco.Cms.Web.Common.PublishedModels;
@inherits UmbracoViewPage<BlockGrid>
@{
Layout = "Layout.cshtml";
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridItem<HeroBlock>>
@inherits UmbracoViewPage<BlockGridItem<HeroBlock>>
@{
var backgroundColor = Model.Content.BackgroundColor;
var image = Model.Content.Image;
var hasBrightContrast = Model.Content.Contrast == "ffffff";
var backgroundColor = Model.Content.Value<string>("backgroundColor");
var image = Model.Content.Value<IPublishedContent>("image");
var hasBrightContrast = Model.Content.Value<string>("contrast") == "ffffff";
}

<pre>Content Picker: @Model.Content.ContentPicker?.Name (@Model.Content.ContentPicker?.Url())</pre>
<pre>Dropdown: @Model.Content.Dropdown</pre>

<div
class="hero"
style="background-color:#@backgroundColor"
@@ -14,9 +17,10 @@
<div class="hero-background" style="background-image: url(@image.GetCropUrl(width:3840))">
</div>
}


<div class="hero-content">
<h1>@Model.Content.Headline</h1>
<h1>@(Model.Content.Value<string>("headline"))</h1>
@* Only render if there is some content... *@
@if (Model.Areas.Any(a => a.Any())) {
@await Html.GetPreviewBlockGridItemAreasHtmlAsync(Model)
Original file line number Diff line number Diff line change
@@ -11,4 +11,9 @@
@(noBackgroundColor ? "nobackgroundcolor" : null)
@(hasBrightContrast ? "bright-contrast" : null)>
@await Html.GetPreviewBlockGridItemAreasHtmlAsync(Model)

@if (Model.Content.BlockGrid != null)
{
@await Html.GetPreviewBlockGridItemsHtmlAsync(Model.Content.BlockGrid)
}
</section>
2 changes: 2 additions & 0 deletions src/Umbraco.Cms.13.x/Views/_ViewImports.cshtml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
@using Umbraco.Extensions
@using Umbraco.Cms._13.x
@using Umbraco.Cms.Web.Common.PublishedModels
@using Umbraco.Cms.Web.Common.PublishedModels.Content
@using Umbraco.Cms.Web.Common.PublishedModels.Elements
@using Umbraco.Cms.Web.Common.Views
@using Umbraco.Cms.Core.Models.PublishedContent
@using Umbraco.Cms.Core.Models.Blocks
2 changes: 1 addition & 1 deletion src/Umbraco.Cms.13.x/appsettings.Development.json
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@
"Debug": true
},
"ModelsBuilder": {
"ModelsMode": "SourceCodeAuto"
"ModelsMode": "Nothing"
},
"RuntimeMinification": {
"UseInMemoryCache": true,
107 changes: 22 additions & 85 deletions src/Umbraco.Cms.13.x/uSync/v9/Content/home.config

Large diffs are not rendered by default.

83 changes: 83 additions & 0 deletions src/Umbraco.Cms.13.x/uSync/v9/Content/nested-test.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<Content Key="f7a52fdf-1a72-44d2-bf0a-0a73379c9497" Alias="Nested Test" Level="2">
<Info>
<Parent Key="6e2ff1f7-114e-484b-a407-918daded1aa6">Home</Parent>
<Path>/Home/NestedTest</Path>
<Trashed>false</Trashed>
<ContentType>blockGrid</ContentType>
<CreateDate>2025-01-22T16:49:04</CreateDate>
<NodeName Default="Nested Test" />
<SortOrder>4</SortOrder>
<Published Default="true" />
<Schedule />
<Template Key="bce3dfc2-5152-427f-999b-0f0901548bdc">BlockGrid</Template>
</Info>
<Properties>
<content>
<Value><![CDATA[{
"layout": {
"Umbraco.BlockGrid": [
{
"contentUdi": "umb://element/66b9ef01d4fa402e91f36fbafc97778d",
"settingsUdi": "umb://element/e7fd8d82f7ce48af8473ab38be7efff1",
"areas": [
{
"key": "9f1c62ff-38ec-4488-bdc4-b39edfd425f3",
"items": []
}
],
"columnSpan": 12,
"rowSpan": 1
}
]
},
"contentData": [
{
"contentTypeKey": "964feee4-efb3-4676-91a0-b960f26e9d92",
"udi": "umb://element/66b9ef01d4fa402e91f36fbafc97778d",
"blockGrid": {
"layout": {
"Umbraco.BlockGrid": [
{
"contentUdi": "umb://element/ddc1e7646f82442e9f7a4d3ff8049bbc",
"areas": [
{
"key": "3b490f17-1471-4ac4-9434-60e676639e29",
"items": []
}
],
"columnSpan": 12,
"rowSpan": 1
}
]
},
"contentData": [
{
"contentTypeKey": "432b58a8-01b7-47dc-8664-f72bf1045f66",
"udi": "umb://element/ddc1e7646f82442e9f7a4d3ff8049bbc",
"headline": "Testing",
"image": [],
"backgroundColor": "",
"contrast": "",
"contentPicker": "umb://document/6e2ff1f7114e484ba407918daded1aa6",
"dropdown": [
"1"
]
}
],
"settingsData": []
}
}
],
"settingsData": [
{
"contentTypeKey": "1a16c578-dacc-4552-ad07-26553c8a34fd",
"udi": "umb://element/e7fd8d82f7ce48af8473ab38be7efff1",
"backgroundColor": "",
"contrast": ""
}
]
}]]></Value>
</content>
</Properties>
</Content>
2 changes: 1 addition & 1 deletion src/Umbraco.Cms.13.x/uSync/v9/Content/services.config
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
<Path>/Home/Services</Path>
<Trashed>false</Trashed>
<ContentType>blockGrid</ContentType>
<CreateDate>2023-08-25T13:17:12</CreateDate>
<CreateDate>2025-01-22T13:58:53</CreateDate>
<NodeName Default="Services" />
<SortOrder>0</SortOrder>
<Published Default="true" />
84 changes: 69 additions & 15 deletions src/Umbraco.Cms.13.x/uSync/v9/Content/test-1.config
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
<ContentType>blockGrid</ContentType>
<CreateDate>2023-09-01T17:13:00</CreateDate>
<NodeName Default="test (1)" />
<SortOrder>2</SortOrder>
<SortOrder>3</SortOrder>
<Published Default="true" />
<Schedule />
<Template Key="bce3dfc2-5152-427f-999b-0f0901548bdc">BlockGrid</Template>
@@ -18,11 +18,41 @@
"layout": {
"Umbraco.BlockGrid": [
{
"contentUdi": "umb://element/db375ac1d47145ae8203c603481a6e52",
"contentUdi": "umb://element/817816df1a3f4f47b3cd1622f6602042",
"settingsUdi": "umb://element/310848da74b74a85893478ee434fb3e7",
"areas": [
{
"key": "3b490f17-1471-4ac4-9434-60e676639e29",
"items": []
"key": "8c07971d-0b53-4b8b-8c4c-826497dbb9e1",
"items": [
{
"contentUdi": "umb://element/e1beccef6a9c4ea08fae9aca97f87c2f",
"areas": [],
"columnSpan": 3,
"rowSpan": 1
}
]
},
{
"key": "fa86159f-27b7-48ca-8bed-93566ccc7352",
"items": [
{
"contentUdi": "umb://element/27e3be3dcf384a199aa88caa70e02424",
"areas": [],
"columnSpan": 3,
"rowSpan": 1
}
]
},
{
"key": "d101715e-8e36-4899-b596-c19fc0793846",
"items": [
{
"contentUdi": "umb://element/90e4ce4260a9450ea68ad85c8276b0bb",
"areas": [],
"columnSpan": 6,
"rowSpan": 1
}
]
}
],
"columnSpan": 12,
@@ -32,19 +62,43 @@
},
"contentData": [
{
"contentTypeKey": "432b58a8-01b7-47dc-8664-f72bf1045f66",
"udi": "umb://element/db375ac1d47145ae8203c603481a6e52",
"image": [],
"headline": "Test",
"contrast": {
"value": "000000",
"label": "000000",
"sortOrder": 0,
"id": "1"
}
"contentTypeKey": "054fd67a-a72d-4044-8226-11abeab7937d",
"udi": "umb://element/817816df1a3f4f47b3cd1622f6602042"
},
{
"contentTypeKey": "e91cd36f-4bdf-4c74-90bf-b2c85fd00dae",
"udi": "umb://element/e1beccef6a9c4ea08fae9aca97f87c2f",
"image": [
{
"key": "e2f775d5-67f1-4c0d-8e73-dc3de7606e49",
"mediaKey": "43933cb4-0d29-412e-8e89-25ae76274b05"
}
]
},
{
"contentTypeKey": "e91cd36f-4bdf-4c74-90bf-b2c85fd00dae",
"udi": "umb://element/27e3be3dcf384a199aa88caa70e02424",
"image": [
{
"key": "41f8090a-a20f-4d0e-8f33-813cadf497b1",
"mediaKey": "87b7776d-f21b-4dda-8325-87b4d004dceb"
}
]
},
{
"contentTypeKey": "62351bd5-75fc-4d93-a6b2-b99439a9161f",
"udi": "umb://element/90e4ce4260a9450ea68ad85c8276b0bb",
"headline": "Test 12 3"
}
],
"settingsData": []
"settingsData": [
{
"contentTypeKey": "1a16c578-dacc-4552-ad07-26553c8a34fd",
"udi": "umb://element/310848da74b74a85893478ee434fb3e7",
"backgroundColor": "",
"contrast": ""
}
]
}]]></Value>
</content>
</Properties>
32 changes: 32 additions & 0 deletions src/Umbraco.Cms.13.x/uSync/v9/ContentTypes/heroblock.config
Original file line number Diff line number Diff line change
@@ -37,6 +37,22 @@
<ValidationRegExpMessage></ValidationRegExpMessage>
<LabelOnTop>false</LabelOnTop>
</GenericProperty>
<GenericProperty>
<Key>3bcba4f1-abb4-41f8-8c52-6fd57d0be8dc</Key>
<Name>Content Picker</Name>
<Alias>contentPicker</Alias>
<Definition>fd1e0da5-5606-4862-b679-5d0cf3a52a59</Definition>
<Type>Umbraco.ContentPicker</Type>
<Mandatory>false</Mandatory>
<Validation></Validation>
<Description><![CDATA[]]></Description>
<SortOrder>4</SortOrder>
<Tab Alias="content">Content</Tab>
<Variations>Nothing</Variations>
<MandatoryMessage></MandatoryMessage>
<ValidationRegExpMessage></ValidationRegExpMessage>
<LabelOnTop>false</LabelOnTop>
</GenericProperty>
<GenericProperty>
<Key>9f76b3b1-d7d4-4982-b828-c7fb528e0c3c</Key>
<Name>Contrast</Name>
@@ -53,6 +69,22 @@
<ValidationRegExpMessage></ValidationRegExpMessage>
<LabelOnTop>false</LabelOnTop>
</GenericProperty>
<GenericProperty>
<Key>0f9e66be-e5df-47b7-86fc-4f4f094956c2</Key>
<Name>Dropdown</Name>
<Alias>dropdown</Alias>
<Definition>0b6a45e7-44ba-430d-9da5-4e46060b9e03</Definition>
<Type>Umbraco.DropDown.Flexible</Type>
<Mandatory>false</Mandatory>
<Validation></Validation>
<Description><![CDATA[]]></Description>
<SortOrder>5</SortOrder>
<Tab Alias="content">Content</Tab>
<Variations>Nothing</Variations>
<MandatoryMessage></MandatoryMessage>
<ValidationRegExpMessage></ValidationRegExpMessage>
<LabelOnTop>false</LabelOnTop>
</GenericProperty>
<GenericProperty>
<Key>5290713e-71f9-4575-8026-7ed536d4a40d</Key>
<Name>Headline</Name>
Original file line number Diff line number Diff line change
@@ -20,6 +20,31 @@
<AllowedTemplates />
</Info>
<Structure />
<GenericProperties />
<Tabs />
<GenericProperties>
<GenericProperty>
<Key>c7b01890-a567-4846-a284-04714012a6fa</Key>
<Name>Block Grid</Name>
<Alias>blockGrid</Alias>
<Definition>c3384287-a9ca-463c-a0b9-adfaa4ca679f</Definition>
<Type>Umbraco.BlockGrid</Type>
<Mandatory>false</Mandatory>
<Validation></Validation>
<Description><![CDATA[]]></Description>
<SortOrder>0</SortOrder>
<Tab Alias="content">Content</Tab>
<Variations>Nothing</Variations>
<MandatoryMessage></MandatoryMessage>
<ValidationRegExpMessage></ValidationRegExpMessage>
<LabelOnTop>false</LabelOnTop>
</GenericProperty>
</GenericProperties>
<Tabs>
<Tab>
<Key>b2400751-31ff-4bc1-81eb-b69922c29fd6</Key>
<Caption>Content</Caption>
<Alias>content</Alias>
<Type>Tab</Type>
<SortOrder>0</SortOrder>
</Tab>
</Tabs>
</ContentType>
Loading

0 comments on commit a4429a5

Please sign in to comment.