Skip to content

Instantly share code, notes, and snippets.

Per Nergård PNergard

Block or report user

Report or block PNergard

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@PNergard
PNergard / Cleaner.aspx
Created Jun 17, 2019
Content cleaner. A Episerver admin mode plugin to let you find content of a specific type and delete all or selected instances
View Cleaner.aspx
<%@ Page Language="c#" CodeBehind="Cleaner.aspx.cs" AutoEventWireup="False" Inherits="LatestEpi.modules.TypeContentCleaner.Cleaner" Title="" %>
<%@ Import Namespace="EPiServer.Web.Mvc.Html" %>
<asp:content contentplaceholderid="MainRegion" runat="server">
<asp:HiddenField runat="server" id="SelectedScheduledJobGUID" ClientIDMode="static" />
<asp:HiddenField runat="server" id="SelectedMedia" ClientIDMode="static" />
<script type="text/javascript">
View LinkItemAllowedTypesAttribute.cs
using EPiServer;
using EPiServer.Core;
using EPiServer.SpecializedProperties;
using EPiServer.Web.Routing;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using System.Web.ModelBinding;
@PNergard
PNergard / SelectManyContentReferenceValidator.cs
Last active Feb 19, 2019
An attribute and a IValidate class that gives the developer the options to point out an IList<ContentReference> property from a string property decorated with a SelectMany attribute so when the editor changes the selectmany property the string contentreferences are added to the IList property so we get an automatically check that a SelectMany un…
View SelectManyContentReferenceValidator.cs
using EPiServer.Core;
using EPiServer.DataAbstraction;
using EPiServer.ServiceLocation;
using EPiServer.Validation;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Web;
@PNergard
PNergard / Basket.aspx
Created Nov 9, 2017
Episerver wastebasket plugin that let admins do simple filtering and delete a single content instead of emptying the whole wastebasket.
View Basket.aspx
<%@ Page Language="c#" CodeBehind="Basket.aspx.cs" AutoEventWireup="False" Inherits="NergardPlayGround.modules.WasteBasket.Basket" Title="" %>
<%@ Import Namespace="EPiServer.Web.Mvc.Html" %>
<asp:content contentplaceholderid="HeaderContentRegion" runat="server">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript" src="//cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
@PNergard
PNergard / LogViewer.aspx
Created Sep 14, 2017
A Episeserver admin mode plugin that let's you see all log messages for a scheduled job instead of having to use paging
View LogViewer.aspx
<%@ Page Language="c#" CodeBehind="LogViewer.aspx.cs" AutoEventWireup="False" Inherits="LatestEpi.modules.ScheduledJobLogViewer.LogViewer" Title="Title" %>
<%@ Import Namespace="EPiServer.DataAbstraction" %>
<asp:content contentplaceholderid="MainRegion" runat="server">
<script type="text/javascript">
function SetSelected() {
$('#SelectedScheduledJobGUID').val($('#JobSelector').val());
//console.log($('#JobSelector option:selected').text());
@PNergard
PNergard / Cleaner.aspx
Created Sep 5, 2017
Assets cleaner. A simple plugin that lets you delete all or selected unreferenced assets
View Cleaner.aspx
<%@ 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 Oct 17, 2016
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.
View EditorScoreBoard.aspx
<%@ 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 Oct 9, 2016
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/
View XhtmlSetting.cs
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 Jul 2, 2016
Episerver initializationmodule that sorts page and block types in alfabetical order.
View ContentTypeReorderInitialization.cs
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 Jun 7, 2016
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.
View Resetter.aspx
<%@ 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 ()
{
You can’t perform that action at this time.