Skip to content

Instantly share code, notes, and snippets.

View ReadonlyBlocks.cs
using System;
using System.Collections.Generic;
using EPiServer.Core;
using EPiServer.Framework;
using EPiServer.Framework.Initialization;
using EPiServer.Shell.ObjectEditing;
namespace Foundation.Features
{
public class ReadonlyBlockMetadataExtender : IMetadataExtender
View ProjectUndoInit.cs
using System;
using System.Collections.Generic;
using System.Linq;
using EPiServer;
using EPiServer.Core;
using EPiServer.Data.Entity;
using EPiServer.DataAbstraction;
using EPiServer.DataAccess;
using EPiServer.Framework;
using EPiServer.Framework.Initialization;
View OrderEventsInit.cs
using EPiServer.Commerce.Order;
using EPiServer.Framework;
using EPiServer.Framework.Initialization;
namespace Foundation._EuromonitorExample
{
[InitializableModule]
[ModuleDependency(typeof(EPiServer.Web.InitializationModule))]
public class OrderEventsInit : IInitializableModule
{
@davidknipe
davidknipe / CreateGetaCategoriesFromEpiserverCategoriesJob.cs
Created Oct 10, 2019
Create Geta Categories based on existing Episerver category structure
View CreateGetaCategoriesFromEpiserverCategoriesJob.cs
using System.Collections.Generic;
using System.Linq;
using EPiServer;
using EPiServer.Core;
using EPiServer.DataAbstraction;
using EPiServer.PlugIn;
using EPiServer.Scheduler;
using Foundation.Cms.Categories;
using Geta.EpiCategories;
using Geta.EpiCategories.Extensions;
@davidknipe
davidknipe / MigrateContentToGetaCategoriesJob.cs
Last active Oct 13, 2019
Migrates content to use Geta Categories. Note will only migrate categories that exist in the Geta Categories structure.
View MigrateContentToGetaCategoriesJob.cs
using System.Collections.Generic;
using System.Linq;
using EPiServer;
using EPiServer.Core;
using EPiServer.DataAbstraction;
using EPiServer.PlugIn;
using EPiServer.Scheduler;
using EPiServer.Security;
using Foundation.Cms.Categories;
using Geta.EpiCategories;
@davidknipe
davidknipe / PostClickInterceptor.cs
Last active Aug 6, 2019
Episerver tracking data interceptor to create Episerver Campaign post clicks from Episerver Insight tracking events
View PostClickInterceptor.cs
using System.Configuration;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Hosting;
using Episerver.Marketing.Common.Helpers;
using EPiServer.ServiceLocation;
using EPiServer.Tracking.Commerce.Data;
using EPiServer.Tracking.Core;
using EPiServer.Tracking.PageView;
View TrackEmailClick.cs
public static void TrackEmailClick(HttpContextBase httpContext, EPiServer.Tracking.Core.ITrackingService trackingService)
{
try
{
var email = GetCurrentUserEmail();
// If you know the users name and/or additional information
// like company name it's also possible to associate here
var userData = new UserData() { Name = email, Email = email };
var trackingData = new TrackingData<object>
{
@davidknipe
davidknipe / index.js
Last active Jun 19, 2018
Alexa skill for Episerver Music Festival to show of the Content Delivery API
View index.js
'use strict';
// --------------- Helpers that build all of the responses -----------------------
var http = require('http');
var axios = require('axios');
var striptags = require('striptags');
function buildSpeechletResponse(title, output, repromptText, shouldEndSession) {
return {
@davidknipe
davidknipe / MigrateDynamicContentToBlocks.cs
Created Apr 11, 2018
Migrate Episerver Dynamic content to Episerver blocks
View MigrateDynamicContentToBlocks.cs
using System.Collections.Generic;
using System.Configuration;
using System.Data.SqlClient;
using System.IO;
using david_tec.Models.Blocks;
using david_tec.Models.Pages;
using EPi.Blog.Templates.PlugIn;
using EPiServer;
using EPiServer.Core;
using EPiServer.Core.Html.StringParsing;
View CustomScopeInterceptor.cs
using EPiServer.ServiceLocation;
using EPiServer.Tracking.Core;
namespace InsightScopes.Business.ChangeScope
{
[ServiceConfiguration(ServiceType = typeof(ITrackingDataInterceptor), Lifecycle = ServiceInstanceScope.Singleton)]
public class CustomScopeInterceptor : ITrackingDataInterceptor
{
public int SortOrder => int.MaxValue; // Ensure the interceptor fires last
You can’t perform that action at this time.