Articles about code samples

24 Oct 2011 ...

Visitor groups and custom criteria in EPiServer

In this post we look at how to create new custom criteria for defining visitor groups in EPiServer.

30 Sep 2011 ...

Check if a dynamic property has been specified on the current page

This post was originally published on EPiServer Labs in February 2009. It gives an example on how to check if a dynamic property has been set explicitly for a specific page.

18 Sep 2011 ...

Single-assembly gadgets for EPiServer

This post presents a concept for creating single-assembly gadgets for EPiServer. This means a gadget can be added to a site by simply dropping a DLL in the bin folder and registering it in web.config.

14 Sep 2011 ...

Create a custom report in EPiServer Report Center

This post explains how to create a custom report for the EPiServer Report Center, an often forgotten but powerful tool for editors and administrators.

3 Sep 2011 ...

Create EPiServer Composer functions with Page Type Builder

In this post we look at how to create Composer functions, such as layout blocks and content blocks, with Page Type Builder.

2 Sep 2011 ...

Create an EPiServer Composer page type with Page Type Builder

Here we look at how to create a new Composer page type and template using EPiServer Composer 4 and Page Type Builder.

11 Jun 2011 ...

Making use of the Tuple class in .NET 4.0

The Tuple class, which was introduced in .NET 4.0, is handy for passing short-lived objects consisting of multiple related values.

27 Apr 2011 ...

Creating a plain HTML page type for EPiServer

Despite risking mean comments about what a content management system is for - this post shows how we created a page type for publishing plain HTML content in EPiServer.

26 Apr 2011 ...

Code snippets for working with languages in EPiServer

These are a few handy code snippets for working with languages and language versions in EPiServer, for example to check if a page exists for a specific language.

24 Apr 2011 ...

Creating simple Dynamic Content in EPiServer CMS 6 R2

This post walks you through a simple example of how to create dynamic content in EPiServer CMS 6 R2 using the new DynamicContentPlugIn attribute.

13 Apr 2011 ...

Create an RSS feed in EPiServer with ETF

This post demonstrates how to use ETF to create new RSS feeds for EPiServer websites.

14 Jan 2011 ...

Disable page-leave check for postbacks inside custom property controls in EPiServer

This post explains how to suppress the alert message displayed when a postback occurs inside a custom property control, for example when a button is clicked.

19 Oct 2010 ...

Create EPiServer dynamic content with advanced settings

This post explains how to use a user control for presenting a user interface to an editor when inserting dynamic content.

19 Oct 2010 ...

Convert to and from Base64-encoding in .NET

Code snippet demonstrating how to convert a string value to and from Base64 encoding in .NET.

28 Sep 2010 ...

Create new dynamic content in EPiServer

One way to create more dynamic page templates in EPiServer is to use dynamic content. Here's an example of how to create dynamic content including dynamic content settings.

6 Sep 2010 ...

Add a stylesheet link programmatically in ASP.NET

Code snippet for programmatically adding a CSS link in ASP.NET.

9 Aug 2010 ...

Unit test an EPiServer 6 website using Visual Studio 2010 and MSTest

When unit testing it can be tricky being dependent on a web context. In this post we'll look at how to start EPiServer and run it outside of a web application to make unit testing easier.

30 Jul 2010 ...

Loading and saving a custom property value with PropertyUserControlBase

The PropertyUserControlBase class in Template Foundation has been updated with two new events called PropertyLoad and PropertySave, making it easier to load and save the property value.

25 Jul 2010 ...

Custom properties in EPiServer using user controls

EPiServer Template Foundation makes it a lot easier to create custom properties based on user controls. In this post we go through the steps needed to create a new custom property in EPiServer and use user controls for rendering the property in edit mode and on page templates.

16 Jul 2010 ...

New EPiServer website using Template Foundation

In this post we'll look at how to set up an EPiServer CMS 6 website from scratch based on EPiServer Template Foundation.

21 Jun 2010 ...

Introduction to EPiServer Template Foundation

In this post we’ll look at how to include EPiServer Template Foundation in your EPiServer project in order to use the different page type base classes and publish EPiServer pages using Windows Live Writer through the MetaWeblog API.

2 Jun 2010 ...

ClassFactory not initialized exception in InitializableModule

The new initialization system in EPiServer 6 can be used to execute logic in a specific order on startup. This post explains how to ensure your startup modules are executed after the DataFactory has been initialized properly.

21 May 2010 ...

Attach EPiServer event handlers on startup using InitializableModule

Explanation of the new InitializableModule concept in EPiServer 6 which is used to implement functionality that should execute when an EPiServer site starts, for example to attach event handlers.

21 May 2010 ...

Create a new page language branch programmatically in EPiServer

This article describes how to create a new language branch programmatically for an existing page in EPiServer.

21 May 2010 ...

Create a page programmatically in EPiServer

Code sample demonstrating how to create new EPiServer pages programmatically using the DataFactory class.

20 May 2010 ...

Search pages in EPiServer using FindPagesWithCriteria

How to find pages in EPiServer by searching using the FindPagesWithCriteria method. The code sample describes how to search in EPiServer using criterias based on page properties.

8 Dec 2009 ...

Introduction to the PageTypeBuilder project

An introduction to Joel Abrahamsson's PageTypeBuilder project for EPiServer. Here I go through the basics of defining a strongly typed page type including page type inheritance.

8 Dec 2009 ...

How to set up an EPiServer website

This post mainly aims to complement Frederik Vig’s posts on setting up a new EPiServer site with some comments and pointer that I find valuable.

12 Oct 2009 ...

Introduction to EPiServer Dynamic Data Store (DDS)

This post provides an introduction to the Dynamic Data Store, or DDS, which was introduced with EPiServer 6.

16 Sep 2009 ...

Parse an EPiServer XHTML property with Dynamic Content

This post explains how to parse XHTML which contains dynamic content in EPiServer so that we can retrieve the actual markup.

14 Apr 2009 ...

Managing e-mail subscriptions in EPiServer

In this post we create an admin plugin for EPiServer which allows administrators to add or remove e-mail subscribers.

26 Aug 2008 ...

Using web parts in EPiServer

This article explains how to use web parts for EPiServer templates using the Web Part Framework for EPiServer which is available on EPiCode.

18 Aug 2008 ...

Run a scheduled job as a specific EPiServer user

This post shows how to login to an EPiServer site programmatically, for example to execute a scheduled job as a specific user.

15 Aug 2008 ...

How to get the simple address of a page in EPiServer

This post explains how to get the simple address of a page, if any. As it turns out, it's just a matter of getting the PageExternalURL property.

8 Aug 2008 ...

Create a scheduled job in EPiServer

This post explains how to create a scheduled job in EPiServer CMS.

24 Jul 2008 ...

Create a custom URL rewrite provider for EPiServer

Post explaining how to implement a custom URL rewrite provider in EPiServer by inheriting the FriendlyUrlRewriteProvider class and customizing its behavior.

7 Feb 2008 ...

How to get the friendly URL of a page in EPiServer CMS

This post explains how to get the friendly URL of a page in EPiServer, handy for those cases where you won't get automatic rewriting of internal URLs.