Skip to content

Instantly share code, notes, and snippets.

@PNergard
PNergard / Cleaner.aspx
Created September 5, 2017 20:39
Assets cleaner. A simple plugin that lets you delete all or selected unreferenced assets
<%@ Page Language="c#" CodeBehind="Cleaner.aspx.cs" AutoEventWireup="False" Inherits="LatestEpi.modules.CleanAssetsPlugin.Cleaner" Title="" %>
<%@ Import Namespace="EPiServer.Web.Mvc.Html" %>
<asp:content contentplaceholderid="MainRegion" runat="server">
<asp:HiddenField runat="server" id="SelectedMedia" ClientIDMode="static" />
<script type="text/javascript">
@PNergard
PNergard / EditorScoreBoard.aspx
Last active October 17, 2016 21:40
A simple .aspx page that get all pages from Root-level and presents how many pages each editor has created as a simple html table.
<%@ Page Language="C#" AutoEventWireup="false" CodeBehind="EditorScoreBoard.aspx.cs" Inherits="AlloyDemoKit.EditorScoreBoard" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style>
.datagrid table {
border-collapse: collapse;
@PNergard
PNergard / XhtmlSetting.cs
Last active October 9, 2016 14:33
Different editor tool buttons for normal editors and administrators. Read more over at my blog: http://world.episerver.com/blogs/Per-Nergard/Dates/2016/10/special-editor-toolbuttons-for-administrators/
using EPiServer.Core;
using EPiServer.Core.PropertySettings;
using EPiServer.Editor.TinyMCE;
using EPiServer.Security;
using EPiServer.ServiceLocation;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
@PNergard
PNergard / ContentTypeReorderInitialization.cs
Created July 2, 2016 18:40
Episerver initializationmodule that sorts page and block types in alfabetical order.
using System;
using System.Linq;
using System.Web;
using EPiServer.Framework;
using EPiServer.Framework.Initialization;
using EPiServer.DataAbstraction;
using System.Collections.Generic;
using EPiServer.ServiceLocation;
namespace AlloyDemoKit.Business.Initialization
@PNergard
PNergard / Resetter.aspx
Last active June 7, 2016 21:40
Plugin for getting an overview of content types that have changes made in admin mode and there for isn't fully syncronized. Possibilites for easy reset. Read blog post over at http://world.episerver.com/blogs/Per-Nergard/Dates/2016/6/overview-of-content-type-syncronization-status/ for more information.
<%@ Page Language="C#" AutoEventWireup="false" CodeBehind="Resetter.aspx.cs" Inherits="AlloyDemoKit.modules.Nergard.TypeReset.Resetter" %>
<asp:content contentplaceholderid="MainRegion" runat="server">
<asp:HiddenField runat="server" id="ValuesToProcess" ClientIDMode="static" />
<script type="text/javascript">
function SelectedModels ()
{
@PNergard
PNergard / AccessrightsOverview.aspx
Created May 16, 2016 20:39
A admin mode plugin to give admins and developers a better overview of how acccess rights are configured in a site.
<%@ Page Language="C#" AutoEventWireup="false" CodeBehind="AccessrightsOverview.aspx.cs" Inherits="AlloyDemoKit.modules.Nergard.AccessRightsOverview.AccessrightsOverview" %>
<%@ Import Namespace="EPiServer.Security" %>
<%@ Register TagPrefix="EPiServerUI" Namespace="EPiServer.UI.WebControls" Assembly="EPiServer.UI" %>
<%@ Register TagPrefix="EPiServerScript" Namespace="EPiServer.ClientScript.WebControls" Assembly="EPiServer" %>
<asp:content contentplaceholderid="MainRegion" runat="server">
<div class="epi-formArea epi-paddingHorizontal">
<fieldset>
@PNergard
PNergard / Singleton.cs
Last active April 18, 2016 18:21
Singleton page- and blocktypes. A attribute and initializationmodule that limits page and block types to only be created once. http://world.episerver.com/blogs/Per-Nergard/Dates/2016/4/limit-block-and-page-types-to-be-created-only-once-updated/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace AlloyDemoKit.Business.DataAnnotations
{
public class Singleton : Attribute
{
}
@PNergard
PNergard / Missingprooperties init module
Last active April 7, 2016 09:55
An initialization module that checks both page- and blocktypes for properties that are no longer defined in code and deletes them. Link to blog post: http://world.episerver.com/blogs/Per-Nergard/Dates/2016/4/missing-properties-initializationmodule/
using System;
using EPiServer.Framework;
using EPiServer.Framework.Initialization;
using System.Web.Configuration;
using EPiServer.DataAbstraction;
using EPiServer.ServiceLocation;
using System.Collections.Generic;
namespace AlloyDemoKit.Business.Initialization
{
@PNergard
PNergard / CustomTypeReorder.aspx
Last active March 18, 2016 08:24
A admin mode plugin to allow sorting of page and block types with drag and drop. Also quicker access to setting up access rights for wich user groups could create the types. Read more over at my blog http://world.episerver.com/blogs/Per-Nergard/Dates/2016/3/order-content-types-with-drag-and-drop/
<%@ Page Language="C#" AutoEventWireup="false" CodeBehind="CustomTypeReorder.aspx.cs" Inherits="AlloyDemoKit.modules.Nergard.ContenttypeReorder.CustomTypeReorder" %>
<%@ Import Namespace="EPiServer.Security" %>
<%@ Register TagPrefix="EPiServerUI" Namespace="EPiServer.UI.WebControls" Assembly="EPiServer.UI" %>
<%@ Register TagPrefix="EPiServerScript" Namespace="EPiServer.ClientScript.WebControls" Assembly="EPiServer" %>
<asp:content contentplaceholderid="MainRegion" runat="server">
<script type="text/javascript">
<%-- Dragula.js --%>
@PNergard
PNergard / CustomTabReorder.aspx
Last active February 2, 2016 22:39
Admin mode plugin supporting drag and drop ordering of tabs. Read the blog post over at Episerver world. http://world.episerver.com/blogs/Per-Nergard/Dates/2016/2/order-tabs-with-drag-and-drop/
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CustomTabReorder.aspx.cs" Inherits="AlloyDemoKit.modules.Nergard.TabsReorder.CustomTabReorder" %>
<%@ Register TagPrefix="EPiServerUI" Namespace="EPiServer.UI.WebControls" Assembly="EPiServer.UI" %>
<%@ Register TagPrefix="EPiServerScript" Namespace="EPiServer.ClientScript.WebControls" Assembly="EPiServer" %>
<asp:content contentplaceholderid="MainRegion" runat="server">
<script type="text/javascript">
//Dragula.js
!function (e) { if ("object" == typeof exports && "undefined" != typeof module) module.exports = e(); else if ("function" == typeof define && define.amd) define([], e); else { var n; n = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this, n.dragula = e() } }(function () { return function e(n, t, r) { function o(u, c) { if (!t[u]) { if (!n[u]) { var a = "function" == typeof require && require; if (!c && a) return a(u, !0); if (i) return i(u, !0); var