Although it's still in an early stage you may be interested in the book I'm writing about EPiServer 7. It aims to provide a structured way of learning EPiServer development, mixing theory with tutorials. Check out the book on Leanpub!
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.
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.
When this article was originally posted the latest version of the CMS was version 6. Many features in that version of EPiServer CMS was tightly coupled to Web Forms, the “classic” way of building sites with ASP.NET. Some of the functionality in EPiServer v. 6, such as gadgets required ASP.NET MVC though.
EPiServer 7 brought full support for template development with ASP.NET MVC. However, as there as Web Forms has been dominating EPiServer development for a long time and a lot of other documentation revolves around Web Forms, when I refer to ASP.NET in this post it’s either Web Forms/MVC-agnostic or Web Forms I’m referring to unless otherwise stated.
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 for both EPiServer 7 and the older version 6.
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
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:
- Content types (Page types and Block types)
- The PageData class/objects
- EPiServer Properties
- Templates (ASPX files for Web Forms and controllers for MVC)
- The TemplatePage and UserControlBase classes (Web Forms)
- The DataFactory class (version 6 and 7) and the IContentRepository interface (version 7)
- Dynamic properties
If(version < 7) Get to know Page Type Builder
If you're looking into version 5 or 6 of the CMS, 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.
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:
- Virtual Path Providers and how EPiServer stores files
- Page Providers
- Dynamic Data Store
- Page Objects
- Output caching
- Dynamic Content
- Read-Only PageData Cache
- Permanent Links
- Membership and Role providers
- Language handling
- Friendly URLs and URL rewriting
- The FilterForVisitor class
Although many of them aren’t very popular within the EPiServer development community, if you're using Web Forms you should also read up on the built-in web controls and how to use them:
- Menu and Listing controls
- How to create a main menu
- How to create Sub Menu
- Data Source Controls
- The built-in searching and filtering functionality
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