Skip to content

Instantly share code, notes, and snippets.

View AndyBoot's full-sized avatar
💭
Thinking about the next idea...

AndyBoot

💭
Thinking about the next idea...
View GitHub Profile
@AndyBoot
AndyBoot / UmbracoBlockListItemView.cs
Last active September 20, 2025 22:41
Provides strongly typed base classes for Umbraco block list item views
/// <summary>
/// Provides strongly typed base classes for Umbraco block list item views,
/// removing the need to inherit <c>UmbracoViewPage&lt;BlockListItem&gt;</c>
/// and manually cast <c>Model.Content</c> and <c>Model.Settings</c> to Models Builder types.
///
/// Use <c>UmbracoBlockListItemView&lt;TContent, TSettings&gt;</c> when your block has both
/// content and settings, or <c>UmbracoBlockListItemView&lt;TContent&gt;</c> when it only has content.
///
/// This allows you to access <c>Content</c> and <c>Settings</c> directly as strongly typed
/// objects, simplifies Razor partials, removes boilerplate casting, and ensures clearer errors
@AndyBoot
AndyBoot / uSyncAllowSegmentation.cs
Last active September 19, 2025 11:24
Seamlessly Allow Segmentation by Extending uSync Imports
/// File: AllowSegmentationUSyncImportingItemNotification.cs
///
/// <summary>
/// Notification handler that ensures specific content types (or all, if no allow-list is provided)
/// have their <Variations> values updated during uSync imports.
/// This forces content types and their properties to support segmentation:
/// - "Nothing" → "Segment"
/// - "Culture" → "CultureAndSegment"
/// All other values are left unchanged.
/// </summary>