Getting started with EPiServer CMS development

Running a fairly well visited blog with quite a few posts about EPiServer development I occasionally receive e-mails from developers that are new to EPiServer. Often they ask for advice on how to get started with EPiServer development. This is my reply.

Prerequisites

EPiServer CMS is based on Microsoft’s ASP.NET. It’s possible to do minor changes to an EPiServer site, or deploy a ready to use template package, without any knowledge of ASP.NET. But in order to leverage the full potential of the CMS you will need to be proficient in ASP.NET development.

At the time of this writing many features in EPiServer CMS is tightly coupled to Web Forms, the “classic” way of building sites with ASP.NET. Support for ASP.NET MVC is coming in future versions and some of the new functionality in EPiServer, such as gadgets, requires ASP.NET MVC. But in general, when I refer to ASP.NET in this post, it’s Web Forms I’m referring to.

Familiarize yourself with EPiServer CMS

The first step in getting started with EPiServer development should be to get to know the product. What it does and what it’s used for. Therefor you should begin by downloading it and installing it. Once you have done that you should use EPiServer’s Deployment Center to set up a site with EPiServer’s basic template package, known as the Public Templates.

Downloads and documentation

EPiServer has it’s own portal for documentation, downloads and support, EPiServer World. Here you’ll find the latest version of  the CMS for download as well as the documentation that EPiServer provides. You’ll also find specific instructions on how to install EPiServer and set up a site with the Public Templates there.

Become an editor

With a sample site set up on your machine you should familiarize yourself with how EPiServer works from an editors perspective. This is a very important step as you’ll get to know some of the basic concepts of EPiServer CMS, and also because it’s very important to think about how the editor(s) work in the CMS when you develop web sites with EPiServer. If the editors are having a hard time publishing content it really doesn’t matter how good the site is from a technical perspective.

To help you EPiServer provides an Editor’s Manual that you can download. You don’t have to read through it all but make sure you understand the basic concepts and try them out. Before you proceed, make sure you understand these concepts:

  • Online Center
  • Edit mode
  • Admin mode
  • Publishing new pages
  • How pages are structured in the Page Tree
  • Page types

Basic development

Once you have familiarized yourself with how editors work in the CMS you’re ready to take the first step to understanding the product as a developer. In order to do so, play around with the sample site that you’ve set up. Try to make minor changes to the various templates and see what happens. Try to add a new property to a page type and render it in a template. Try to list all of the children of a specific page.

EPiServer provides some documentation that will help you get started. Make especially sure that you read the Important Concepts part of it. Once you’ve played around a little, make sure to read up on the PageData, PageBase and DataFactory classes in the EPiServer SDK.

Ted Nyberg’s Introduction to EPiServer properties can also be a great help in understanding some of the most important concepts of EPiServer development. So can my guide on How to create a custom EPiServer property, although you shouldn’t feel stressed if you’re having a hard time understanding everything as they are quite advanced. Reading these guides at this point might leave you feeling a bit confused, but you’ll be rewarded for it later.

Make sure you have at least a basic understanding of these concepts/classes:

  • Page types
  • The PageData class/objects
  • EPiServer Properties
  • Templates (ASPX files)
  • The TemplatePage and UserControlBase classes
  • The DataFactory class
  • Dynamic properties

Get to know Page Type Builder

Once you have a basic understanding of how EPiServer development works you might have seen a couple of flaws in EPiServer CMS’ content model. One is that Page Types are stored in the database and there is no inheritance between them. Another is that you have to use (magic) strings to fetch values from PageData objects.

Page Type Builder is an open source projects that alleviates some of these problems. Using Page Type Builder will make the development experience better and it has become more or less standard in the EPiServer development community lately.

At the project’s site you’ll find a number of links to tutorials and guides. You might want to begin by reading the basic introduction and then proceed to the Developing with Page Type Builder tutorial. Ted Nyberg has also written an introduction to the project that you might want to read as well.

Learn best practices from the EPiServer community

Over the years thousands of sites have been built on different versions of EPiServer CMS. During this time a number of best practices and standards have evolved and been identified. Some are more or less universal, such as storing settings on the start page, while some differ from company to company and from developer to developer.

If you know Swedish it’s a good idea to read the EPiServer Coding Guidelines that the Stockholm EPiServer Meetup Community has produced. Frederik Vig has written a lengthy tutorial on how to create an EPiServer site from scratch (in english) that you should definitely read as well.

Also make sure to read Fredrik Haglund’s articles about Best Coding Practices for EPiServer CMS and Do’s and Don’ts with EPiServer properties.

Understand the EPiServer API

With basic knowledge about EPiServer development and Page Type Builder you should proceed to learn more about the various features and APIs offered by EPiServer, as well as gain some very important understanding about how EPiServer works under the covers.

One way of getting to know the EPiServer API and really understand how it works is to use .NET Reflector which is a tool that let’s you browse the disassembled versions of assemblies. At the time of this writing it’s free but in the future it will cost $35 which it’s well worth.

Personally I think that one of the most important things to learn is how EPiServer caches PageData objects as knowledge about that will help you avoid many performance pitfalls. The linked to article also explains some important aspects of various ways of locating pages in EPiServer.

Also make sure to read up on:

Although many of them aren’t very popular within the EPiServer development community you should also read up on the built-in web controls and how to use them:

Learn how to extend EPiServer CMS

EPiServer provides a large number of extension points. Some are provided as events in the API and others as areas for which you can create plugins. A third way of extending EPiServer CMS is to create custom property types.

You should learn how to create a custom property and how to map custom controls to property types. You should also learn how to create a scheduled job including some of the advanced features the scheduling functionality provides. Furthermore, make sure you to get a basic understanding of all of the areas where you can plug in your own functionality, for instance by reading Frederik Vig’s post Creating an EPiServer Plugin.

Get involved in the EPiServer community

There is a steadily growing and very nice community of developers working with EPiServer CMS that can both help you when you run into problems and give you inspiration. It is however not really consolidated to one central location or site although most blog posts are syndicated to EPiServer World.

There are a number of groups that regularly meet in Stockholm, Oslo, Malmö/Copenhagen and London. You’ll also find a lot of chatter about EPiServer on Twitter (search for the hash tag EPiServer). I’ve previously put together a list of Twitter users that include many in the community that you might want to follow.

More resources and information

  • EPiWiki – Mattias Lövström at EPiServer’s expert services notebook
  • EPiServer Developer Resources – Frederik Vig’s list of EPiServer developer resources
  • EPiCode – A collection of various open source projects for EPiServer CMS

PS. For updates about new posts, sites I find useful and the occasional rant you can follow me on Twitter. You are also most welcome to subscribe to the RSS-feed.

Comments

  1. Andy's avatar

    Andy 1 years ago

    Great post!
    What is the preferred way of builden menus in EPiServer if not with the built in menu controls?

  2. Ted Nyberg's avatar

    Ted Nyberg 1 years ago

    Great work! I'm keeping this link close and handy for future reference - good place for newcomers to start!

  3. Joel Abrahamsson's avatar

    Joel Abrahamsson 1 years ago

    Andy,

    The built in menu controls are pretty good actually. Some tend to use regular Repeaters instead though. The TypedTemplating project is also an option http://joelabrahamsson.com/entry/updates-to-the-typed-templating-project

  4. Roger's avatar

    Roger 1 years ago

    Great post!

Follow me on Twitter

  1. @tim_abell The gigantic ones are for customers who specifically ask for them only :) 1 months ago
  2. Looking to buy a gigantic easter egg filled with candy for delivery in Stockholm. Any recommendations? 1 months ago
  3. @strandberg_m Du måste skriva om resultatet efteråt! 1 months ago
follow me

Latest comments

  1. Joel Abrahamsson wrote "Hi Jonas! The fluent API is really geared towards working..." on Building a search page for an EPiServer site using Truffler
  2. Jonas wrote "Thank you for one more great write up! If you're not lucky ..." on Building a search page for an EPiServer site using Truffler
  3. David Knipe wrote "The CategoriesFacet method will save me a load of headaches ..." on Cool new features in the Truffler .NET API

About this site

This blog is built with EPiServer Community, EPiServer CMS, ASP.NET MVC and a bunch of other great products. The source code is available for download at the projects page, where you also can read more about this site and my other projects.

read more