Skip to content

Instantly share code, notes, and snippets.

@markeverard
markeverard / FeedItemModifier.cs
Created November 30, 2018 20:04
Chief2moro.SyndicationFeeds IItemModifier Setup
/// Based on Episerver V11, and Syndication Feed V11
using Chief2moro.SyndicationFeeds;
using EPiServer.Core;
using System.ServiceModel.Syndication;
using MarieCurie.Domain.Models.Base;
using EPiServer.ServiceLocation;
using EPiServer;
using EPiServer.Web.Routing;
using System.Xml.Linq;
@markeverard
markeverard / DxcEnvironmentHelpers.cs
Last active November 30, 2018 20:07
Episerver DXC Helper class
using System.Configuration;
namespace Chief2moro.Helpers
{
public enum DxcEnvironment
{
Development,
Integration,
Preproduction,
Production
using EPiServer;
using EPiServer.Core;
using EPiServer.Framework;
using EPiServer.Framework.Initialization;
using EPiServer.ServiceLocation;
namespace Scenarios.Business.Initializations
{
[ModuleDependency(typeof(EPiServer.Web.InitializationModule))]
public class MakerChannelHookInitialisation : IInitializableModule
@markeverard
markeverard / MakerChannelWebHookSender.cs
Last active April 20, 2018 09:51
Class containing a method to send a webhook to the IFTTT Maker channel
using System.Net;
namespace Scenarios
{
public class MakerChannelWebHookSender
{
private string iftttApiKey = "sign-up-to-ifttt-to-get-a-key";
public void Send(string eventName, string value1, string value2, string value3)
{
<% @ Page Language="C#" %>
<%
foreach (string var in Request.ServerVariables)
{
Response.Write(var + " " + Request[var] + "<br>");
}
%>
@markeverard
markeverard / unusedmediaslice
Last active December 15, 2022 19:05
Unused Media Slice
using System.Diagnostics;
using System.Linq;
using EPiServer;
using EPiServer.Cms.Shell.UI.Rest.ContentQuery;
using EPiServer.Core;
using EPiServer.DataAbstraction;
using EPiServer.Find;
using EPiServer.ServiceLocation;
using EPiServer.Shell.ContentQuery;
using EPiServer.Shell.Rest;
@markeverard
markeverard / unusedblocksslice
Created March 15, 2015 21:23
Unused Blocks Slice
using System.Diagnostics;
using System.Linq;
using EPiServer;
using EPiServer.Cms.Shell.UI.Rest.ContentQuery;
using EPiServer.Core;
using EPiServer.DataAbstraction;
using EPiServer.Find;
using EPiServer.ServiceLocation;
using EPiServer.Shell.ContentQuery;
using EPiServer.Shell.Rest;
@markeverard
markeverard / PageListing.aspx
Created March 6, 2015 00:09
EPiServer ASPX PageListing
<%@ Page Language="C#" AutoEventWireup="true" %>
<%@ Import Namespace="EPiServer" %>
<%@ Import Namespace="EPiServer.Core" %>
<%@ Import Namespace="EPiServer.DataAbstraction" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
@markeverard
markeverard / BootstrapDisplayModeFallbackProvider
Created November 28, 2014 15:53
Example needed to provide new data to EPiBootstrapArea ContentArea Renderer
using System.Collections.Generic;
using EPiBootstrapArea;
namespace Example
{
public class BootstrapDisplayModeFallbackProvider : IDisplayModeFallbackProvider
{
public List<DisplayModeFallback> GetAll()
{
var initialData = new List<DisplayModeFallback>
@markeverard
markeverard / web.config.rewriterules
Last active August 29, 2015 14:10
Modify Urls for test environment
<rewrite>
<outboundRules>
<!-- Convert all production urls to the correct local environment - in this case test -->
<rule name="EnsureCorrectEnvironment-WEB" preCondition="Is_HTML" patternSyntax="Wildcard">
<match filterByTags="A, Form, Frame, IFrame, Img, Link, Script" pattern="*://www.yoursite.com/*" />
<action type="Rewrite" value="{R:1}://test.yoursite.com/{R:2}" />
</rule>
<preConditions>
<preCondition name="Is_HTML">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />