Skip to content

Instantly share code, notes, and snippets.

View KevinJump's full-sized avatar
🚴

Kevin Jump KevinJump

🚴
View GitHub Profile
<div>
<umb-load-indicator ng-if="model.loading"></umb-load-indicator>
<umb-box ng-if="!model.loading">
<umb-box-header title="Notifications"
description="Define who will get an email when key events occur (';' seperated lists)">
</umb-box-header>
<umb-box-content>
<umb-control-group label="Pending Notifications"
description="Email addresses to notify">
//
// Example: Hooking into TranslationManager (v8) Events
//
// Shows you how to register for the Events fired by Translation Manager
// these are the job events, each one gets the job object passed to it
// so you can extract info and workout what you might want to do.
//
//
// Packages (if not in web project)
@KevinJump
KevinJump / deleteprotect.cs
Created September 25, 2019 10:49
uSync Delete Protect - Save Media before it goes from the recycle bin.
using Jumoo.uSync.Core;
using Jumoo.uSync.Core.Interfaces;
using Newtonsoft.Json;
using System.IO;
using System.Linq;
using Umbraco.Core;
using Umbraco.Core.IO;
@KevinJump
KevinJump / uSyncCacheRebuild.cs
Last active September 26, 2019 14:33
uSync 8.2 Cache rebuild
using System.Linq;
using Umbraco.Core.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.Services.Changes;
using Umbraco.Web.Cache;
using Umbraco.Web.PublishedCache;
using uSync8.BackOffice;
namespace uSync8.EventTriggers
@KevinJump
KevinJump / LeBlenderValueMapper.cs
Created November 1, 2019 14:41
LeBlender Value mapper for Translation Manager for v2.x
using Jumoo.TranslationManager.Core.Models;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core;
@KevinJump
KevinJump / documentlist.cshtml
Last active February 19, 2020 16:19
Umbraco Macro file to render a list of documents on a page
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@using Umbraco.Web.Models
@{
var folders = Model.GetParameterValue<string>("mediaFolder", "")
.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
var subFolders = Model.GetParameterValue<bool>("subFolders", true);
var selection = Umbraco.TypedMedia(folders).Where(x => x != null);
@KevinJump
KevinJump / vortohealthcheck.cs
Created March 31, 2020 07:44
Quick and dirty Health check to fix non-json vorto properties, if you change from a text property to a vorto one, then the stored values will need updating, this health check can do that
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.Services;
using Umbraco.Web.HealthCheck;
@KevinJump
KevinJump / NodeNameCopy.cs
Created May 6, 2020 08:40
TranslationManager : Copy the NodeName on TranslationJob Approval
using System;
using Jumoo.TranslationManager.Core.Services;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.Services;
namespace Jumoo.Translation.ExampleCode
{
//
// Example Code : CopyNodeName on Approval
@KevinJump
KevinJump / SilentUpgradeStartup.cs
Last active May 19, 2020 11:03
Umbraco SilentUpgrade : Run the Umbraco Upgrade silently with no redirect to the /install url for users. (see https://github.com/KevinJump/Our.Umbraco.SilentUpgrade)
/*
* Silent Upgrade for Umbraco v8.
* ---------------------------------
*
* HEALTH WARNING: Look this is doing some internal umbraco 'messing' about, using this
* to auto upgrade your umbraco installations is done at your own risk.
*
* This code will run when your site is in Upgrade mode.
* This happens when the version in web.config or the database migrations don't
* match what the umbraco code thinks should be the version.
using Jumoo.TranslationManager.Core.Services;
using Umbraco.Core;
using Umbraco.Core.Logging;
namespace TranslationManager.Events
{
/// <summary>
/// Exmaple how listen for events on translation jobs. in Translation Manager (v2.x)
/// </summary>