From 15807ce3dd556714bbe4cfeeef557da4b5a37e12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20Bjurstr=C3=B6m?= Date: Tue, 19 May 2026 11:45:44 +0200 Subject: [PATCH 1/2] Update dependencies --- templates/Alloy.Mvc/Alloy.Mvc.1.csproj | 4 ++-- templates/Cms.Empty/Cms.Empty.1.csproj | 4 ++-- templates/Cms.Item/Cms.Item.csproj | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/Alloy.Mvc/Alloy.Mvc.1.csproj b/templates/Alloy.Mvc/Alloy.Mvc.1.csproj index e085054..1131b77 100644 --- a/templates/Alloy.Mvc/Alloy.Mvc.1.csproj +++ b/templates/Alloy.Mvc/Alloy.Mvc.1.csproj @@ -13,8 +13,8 @@ - - + + diff --git a/templates/Cms.Empty/Cms.Empty.1.csproj b/templates/Cms.Empty/Cms.Empty.1.csproj index c087c6d..3b807f3 100644 --- a/templates/Cms.Empty/Cms.Empty.1.csproj +++ b/templates/Cms.Empty/Cms.Empty.1.csproj @@ -13,8 +13,8 @@ - - + + diff --git a/templates/Cms.Item/Cms.Item.csproj b/templates/Cms.Item/Cms.Item.csproj index d5dda95..77a8f12 100644 --- a/templates/Cms.Item/Cms.Item.csproj +++ b/templates/Cms.Item/Cms.Item.csproj @@ -6,6 +6,6 @@ - + From 934ce73247ca179860683bd00fde7a4686f32726 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20Bjurstr=C3=B6m?= Date: Tue, 19 May 2026 11:39:54 +0200 Subject: [PATCH 2/2] Flatten SiteContentType to use ContentType Removes the SiteContentType attribute wrapper from the Alloy.Mvc template and updates all page and block model classes to use [ContentType(...)] directly, matching how StartPage already declares its content type. For the models that previously relied on the wrapper's default GroupName the value is now set explicitly so behavior is preserved. Fixes: CMS-52433 --- templates/Alloy.Mvc/Models/Blocks/ButtonBlock.cs | 4 +++- templates/Alloy.Mvc/Models/Blocks/ContactBlock.cs | 4 +++- templates/Alloy.Mvc/Models/Blocks/EditorialBlock.cs | 2 +- templates/Alloy.Mvc/Models/Blocks/JumbotronBlock.cs | 2 +- templates/Alloy.Mvc/Models/Blocks/PageListBlock.cs | 4 +++- .../Alloy.Mvc/Models/Blocks/SiteLogotypeBlock.cs | 3 ++- templates/Alloy.Mvc/Models/Blocks/TeaserBlock.cs | 4 +++- templates/Alloy.Mvc/Models/Pages/ArticlePage.cs | 2 +- templates/Alloy.Mvc/Models/Pages/ContactPage.cs | 2 +- templates/Alloy.Mvc/Models/Pages/ContainerPage.cs | 2 +- templates/Alloy.Mvc/Models/Pages/LandingPage.cs | 2 +- templates/Alloy.Mvc/Models/Pages/NewsPage.cs | 4 +++- templates/Alloy.Mvc/Models/Pages/ProductPage.cs | 2 +- templates/Alloy.Mvc/Models/Pages/SearchPage.cs | 2 +- templates/Alloy.Mvc/Models/Pages/StandardPage.cs | 4 +++- templates/Alloy.Mvc/Models/SiteContentType.cs | 12 ------------ 16 files changed, 28 insertions(+), 27 deletions(-) delete mode 100644 templates/Alloy.Mvc/Models/SiteContentType.cs diff --git a/templates/Alloy.Mvc/Models/Blocks/ButtonBlock.cs b/templates/Alloy.Mvc/Models/Blocks/ButtonBlock.cs index 98b3d64..ae2f246 100644 --- a/templates/Alloy.Mvc/Models/Blocks/ButtonBlock.cs +++ b/templates/Alloy.Mvc/Models/Blocks/ButtonBlock.cs @@ -5,7 +5,9 @@ namespace Alloy.Mvc._1.Models.Blocks; /// /// Used to insert a link which is styled as a button /// -[SiteContentType(GUID = "426CF12F-1F01-4EA0-922F-0778314DDAF0")] +[ContentType( + GUID = "426CF12F-1F01-4EA0-922F-0778314DDAF0", + GroupName = Globals.GroupNames.Default)] [SiteImageUrl] public class ButtonBlock : SiteBlockData { diff --git a/templates/Alloy.Mvc/Models/Blocks/ContactBlock.cs b/templates/Alloy.Mvc/Models/Blocks/ContactBlock.cs index 8a26354..e3b4d33 100644 --- a/templates/Alloy.Mvc/Models/Blocks/ContactBlock.cs +++ b/templates/Alloy.Mvc/Models/Blocks/ContactBlock.cs @@ -7,7 +7,9 @@ namespace Alloy.Mvc._1.Models.Blocks; /// Used to present contact information with a call-to-action link /// /// Actual contact details are retrieved from a contact page specified using the ContactPageLink property -[SiteContentType(GUID = "7E932EAF-6BC2-4753-902A-8670EDC5F363")] +[ContentType( + GUID = "7E932EAF-6BC2-4753-902A-8670EDC5F363", + GroupName = Globals.GroupNames.Default)] [SiteImageUrl] public class ContactBlock : SiteBlockData { diff --git a/templates/Alloy.Mvc/Models/Blocks/EditorialBlock.cs b/templates/Alloy.Mvc/Models/Blocks/EditorialBlock.cs index 9accd1b..db2f50f 100644 --- a/templates/Alloy.Mvc/Models/Blocks/EditorialBlock.cs +++ b/templates/Alloy.Mvc/Models/Blocks/EditorialBlock.cs @@ -5,7 +5,7 @@ namespace Alloy.Mvc._1.Models.Blocks; /// /// Used to insert editorial content edited using a rich-text editor /// -[SiteContentType( +[ContentType( GUID = "67F617A4-2175-4360-975E-75EDF2B924A7", GroupName = SystemTabNames.Content)] [SiteImageUrl] diff --git a/templates/Alloy.Mvc/Models/Blocks/JumbotronBlock.cs b/templates/Alloy.Mvc/Models/Blocks/JumbotronBlock.cs index 93851f1..2bd7ee6 100644 --- a/templates/Alloy.Mvc/Models/Blocks/JumbotronBlock.cs +++ b/templates/Alloy.Mvc/Models/Blocks/JumbotronBlock.cs @@ -6,7 +6,7 @@ namespace Alloy.Mvc._1.Models.Blocks; /// /// Used for a primary message on a page, commonly used on start pages and landing pages /// -[SiteContentType( +[ContentType( GroupName = Globals.GroupNames.Specialized, GUID = "9FD1C860-7183-4122-8CD4-FF4C55E096F9")] [SiteImageUrl] diff --git a/templates/Alloy.Mvc/Models/Blocks/PageListBlock.cs b/templates/Alloy.Mvc/Models/Blocks/PageListBlock.cs index ed44e23..0a736d9 100644 --- a/templates/Alloy.Mvc/Models/Blocks/PageListBlock.cs +++ b/templates/Alloy.Mvc/Models/Blocks/PageListBlock.cs @@ -7,7 +7,9 @@ namespace Alloy.Mvc._1.Models.Blocks; /// /// Used to insert a list of pages, for example a news list /// -[SiteContentType(GUID = "30685434-33DE-42AF-88A7-3126B936AEAD")] +[ContentType( + GUID = "30685434-33DE-42AF-88A7-3126B936AEAD", + GroupName = Globals.GroupNames.Default)] [SiteImageUrl] public class PageListBlock : SiteBlockData { diff --git a/templates/Alloy.Mvc/Models/Blocks/SiteLogotypeBlock.cs b/templates/Alloy.Mvc/Models/Blocks/SiteLogotypeBlock.cs index 99a5348..26da86e 100644 --- a/templates/Alloy.Mvc/Models/Blocks/SiteLogotypeBlock.cs +++ b/templates/Alloy.Mvc/Models/Blocks/SiteLogotypeBlock.cs @@ -7,8 +7,9 @@ namespace Alloy.Mvc._1.Models.Blocks; /// /// Used to provide a composite property on the start page to set site logotype settings /// -[SiteContentType( +[ContentType( GUID = "09854019-91A5-4B93-8623-17F038346001", + GroupName = Globals.GroupNames.Default, AvailableInEditMode = false)] // Should not be created and added to content areas by editors, the SiteLogotypeBlock is only used as a property type [SiteImageUrl] public class SiteLogotypeBlock : SiteBlockData diff --git a/templates/Alloy.Mvc/Models/Blocks/TeaserBlock.cs b/templates/Alloy.Mvc/Models/Blocks/TeaserBlock.cs index ef423be..7e03e10 100644 --- a/templates/Alloy.Mvc/Models/Blocks/TeaserBlock.cs +++ b/templates/Alloy.Mvc/Models/Blocks/TeaserBlock.cs @@ -6,7 +6,9 @@ namespace Alloy.Mvc._1.Models.Blocks; /// /// Used to provide a stylized entry point to a page on the site /// -[SiteContentType(GUID = "EB67A99A-E239-41B8-9C59-20EAA5936047")] // BEST PRACTICE TIP: Always assign a GUID explicitly when creating a new block type +[ContentType( + GUID = "EB67A99A-E239-41B8-9C59-20EAA5936047", + GroupName = Globals.GroupNames.Default)] [SiteImageUrl] // Use site's default thumbnail public class TeaserBlock : SiteBlockData { diff --git a/templates/Alloy.Mvc/Models/Pages/ArticlePage.cs b/templates/Alloy.Mvc/Models/Pages/ArticlePage.cs index d24070b..7016e87 100644 --- a/templates/Alloy.Mvc/Models/Pages/ArticlePage.cs +++ b/templates/Alloy.Mvc/Models/Pages/ArticlePage.cs @@ -3,7 +3,7 @@ namespace Alloy.Mvc._1.Models.Pages; /// /// Used primarily for publishing news articles on the website /// -[SiteContentType( +[ContentType( GroupName = Globals.GroupNames.News, GUID = "AEECADF2-3E89-4117-ADEB-F8D43565D2F4")] [SiteImageUrl(Globals.StaticGraphicsFolderPath + "page-type-thumbnail-article.png")] diff --git a/templates/Alloy.Mvc/Models/Pages/ContactPage.cs b/templates/Alloy.Mvc/Models/Pages/ContactPage.cs index 809cf99..6df5739 100644 --- a/templates/Alloy.Mvc/Models/Pages/ContactPage.cs +++ b/templates/Alloy.Mvc/Models/Pages/ContactPage.cs @@ -7,7 +7,7 @@ namespace Alloy.Mvc._1.Models.Pages; /// /// Represents contact details for a contact person /// -[SiteContentType( +[ContentType( GUID = "F8D47655-7B50-4319-8646-3369BA9AF05B", GroupName = Globals.GroupNames.Specialized)] [SiteImageUrl(Globals.StaticGraphicsFolderPath + "page-type-thumbnail-contact.png")] diff --git a/templates/Alloy.Mvc/Models/Pages/ContainerPage.cs b/templates/Alloy.Mvc/Models/Pages/ContainerPage.cs index acabef9..a7c2f1c 100644 --- a/templates/Alloy.Mvc/Models/Pages/ContainerPage.cs +++ b/templates/Alloy.Mvc/Models/Pages/ContainerPage.cs @@ -5,7 +5,7 @@ namespace Alloy.Mvc._1.Models.Pages; /// /// Used to logically group pages in the page tree /// -[SiteContentType( +[ContentType( GUID = "D178950C-D20E-4A46-90BD-5338B2424745", GroupName = Globals.GroupNames.Specialized)] [SiteImageUrl] diff --git a/templates/Alloy.Mvc/Models/Pages/LandingPage.cs b/templates/Alloy.Mvc/Models/Pages/LandingPage.cs index 163703f..71e9c85 100644 --- a/templates/Alloy.Mvc/Models/Pages/LandingPage.cs +++ b/templates/Alloy.Mvc/Models/Pages/LandingPage.cs @@ -5,7 +5,7 @@ namespace Alloy.Mvc._1.Models.Pages; /// /// Used for campaign or landing pages, commonly used for pages linked in online advertising such as AdWords /// -[SiteContentType( +[ContentType( GUID = "DBED4258-8213-48DB-A11F-99C034172A54", GroupName = Globals.GroupNames.Specialized)] [SiteImageUrl] diff --git a/templates/Alloy.Mvc/Models/Pages/NewsPage.cs b/templates/Alloy.Mvc/Models/Pages/NewsPage.cs index 3b6e687..d8afc6a 100644 --- a/templates/Alloy.Mvc/Models/Pages/NewsPage.cs +++ b/templates/Alloy.Mvc/Models/Pages/NewsPage.cs @@ -10,7 +10,9 @@ namespace Alloy.Mvc._1.Models.Pages; /// /// Presents a news section including a list of the most recent articles on the site /// -[SiteContentType(GUID = "638D8271-5CA3-4C72-BABC-3E8779233263")] +[ContentType( + GUID = "638D8271-5CA3-4C72-BABC-3E8779233263", + GroupName = Globals.GroupNames.Default)] [SiteImageUrl] public class NewsPage : StandardPage { diff --git a/templates/Alloy.Mvc/Models/Pages/ProductPage.cs b/templates/Alloy.Mvc/Models/Pages/ProductPage.cs index 49398cd..eca31b8 100644 --- a/templates/Alloy.Mvc/Models/Pages/ProductPage.cs +++ b/templates/Alloy.Mvc/Models/Pages/ProductPage.cs @@ -6,7 +6,7 @@ namespace Alloy.Mvc._1.Models.Pages; /// /// Used to present a single product /// -[SiteContentType( +[ContentType( GUID = "17583DCD-3C11-49DD-A66D-0DEF0DD601FC", GroupName = Globals.GroupNames.Products)] [SiteImageUrl(Globals.StaticGraphicsFolderPath + "page-type-thumbnail-product.png")] diff --git a/templates/Alloy.Mvc/Models/Pages/SearchPage.cs b/templates/Alloy.Mvc/Models/Pages/SearchPage.cs index 36d2463..0a4493d 100644 --- a/templates/Alloy.Mvc/Models/Pages/SearchPage.cs +++ b/templates/Alloy.Mvc/Models/Pages/SearchPage.cs @@ -6,7 +6,7 @@ namespace Alloy.Mvc._1.Models.Pages; /// /// Used to provide on-site search /// -[SiteContentType( +[ContentType( GUID = "AAC25733-1D21-4F82-B031-11E626C91E30", GroupName = Globals.GroupNames.Specialized)] [SiteImageUrl] diff --git a/templates/Alloy.Mvc/Models/Pages/StandardPage.cs b/templates/Alloy.Mvc/Models/Pages/StandardPage.cs index e7f5db2..b5426dd 100644 --- a/templates/Alloy.Mvc/Models/Pages/StandardPage.cs +++ b/templates/Alloy.Mvc/Models/Pages/StandardPage.cs @@ -5,7 +5,9 @@ namespace Alloy.Mvc._1.Models.Pages; /// /// Used for the pages mainly consisting of manually created content such as text, images, and blocks /// -[SiteContentType(GUID = "9CCC8A41-5C8C-4BE0-8E73-520FF3DE8267")] +[ContentType( + GUID = "9CCC8A41-5C8C-4BE0-8E73-520FF3DE8267", + GroupName = Globals.GroupNames.Default)] [SiteImageUrl(Globals.StaticGraphicsFolderPath + "page-type-thumbnail-standard.png")] public class StandardPage : SitePageData { diff --git a/templates/Alloy.Mvc/Models/SiteContentType.cs b/templates/Alloy.Mvc/Models/SiteContentType.cs deleted file mode 100644 index d337cea..0000000 --- a/templates/Alloy.Mvc/Models/SiteContentType.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Alloy.Mvc._1.Models; - -/// -/// Attribute used for site content types to set default attribute values -/// -public class SiteContentType : ContentTypeAttribute -{ - public SiteContentType() - { - GroupName = Globals.GroupNames.Default; - } -}