Skip to content

Instantly share code, notes, and snippets.

View KevinJump's full-sized avatar

Kevin Jump KevinJump

View GitHub Profile
KevinJump / nestedcontentv8convertion.cs
Created April 29, 2024 09:20
uSync Migrator and plan to make nested content go through the conversion process in v8 (which it doesn't by default).
using uSync.Migrations.Core;
using uSync.Migrations.Core.Handlers;
using uSync.Migrations.Core.Legacy;
using uSync.Migrations.Core.Migrators;
using uSync.Migrations.Core.Plans;
using uSync.Migrations.Core.Plans.Models;
using uSync.Migrations.Migrators.Core;
namespace MyMigrations;
KevinJump / MovePublisherTree.cs
Last active September 29, 2023 07:15
Move Publisher Section
using Microsoft.AspNetCore.Authorization;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Core.Events;
using Umbraco.Cms.Core.Sections;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Trees;
using Umbraco.Cms.Web.BackOffice.Trees;
using Umbraco.Cms.Web.Common.Attributes;
KevinJump / dailyrestore.cs
Created September 26, 2023 14:28
Umbraco Hangfire + uSync.Complete Create a restore point
using Hangfire;
using Hangfire.Server;
using Umbraco.Cms.Core.Composing;
using uSync.Expansions.Core.Restore.Services;
namespace uSync.Hangfire;
public class DailyRestoreComposer : IComposer
KevinJump / WordCountController.cs
Created June 28, 2023 16:01
v8 - word count controller - does a hacky version of the full child page counting we do in v10/11/12
using System.Web.Http;
using Jumoo.TranslationManager.Core.Controllers;
using Newtonsoft.Json;
using Umbraco.Core.Services;
using Umbraco.Web.Mvc;
using Umbraco.Web.WebApi;
KevinJump / allproperties.cshtml
Created May 2, 2023 15:12
Display all the properties (and nested properties) for a content node in Umbraco 10/11.
@using Umbraco.Cms.Web.Common.PublishedModels;
@using Umbraco.Cms.Core.Models;
@using Umbraco.Cms.Core.Models.Blocks;
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage
Layout = null;
KevinJump / UmbNavValueMapper.cs
Created March 17, 2023 15:46
UmbNav - ValueMapper for Umbraco 8.x - Translation manager v8.7.x
using System.Linq;
using Jumoo.TranslationManager.Core;
using Jumoo.TranslationManager.Core.Models;
using Jumoo.TranslationManager.Core.ValueMappers;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Umbraco.Core;
KevinJump / CopyNodeName.cs
Created October 20, 2022 12:01
Translation Manager v8 - Copy the node name between source and target languages when a translation is approaved
using Jumoo.TranslationManager.Core.Services;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.Services;
namespace ExampleCode
// Example Code : CopyNodeName on Approval
KevinJump / maintain.cs
Last active February 20, 2022 11:57
change umbraco content in middleware (example, may need some work!)
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using System.IO;
using System.Threading.Tasks;
using Umbraco.Cms.Core.Composing;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
KevinJump / numbraco.ps1
Last active March 12, 2024 00:45
Umbraco Setup and tear down scripts. (Gives you an approx 35 second Umbraco install)
# statup umbraco, and add some packages if you want
# e.g numbraco MyTestSite uSync Jumoo.TranslationManager vendr -NoStarter
# extras!!!
# open vscode in the folder as part of the build
# numbraco MyTestSite -code
# don't run the site