This section of the SDK documentation contains information about the most central concepts of an EPiServer CMS project and how they relate to each other.

Page Type

A page type defines a set of properties that each page of the type will have. To draw a (very generalized) paralell to programming you can say that the page types are class definitions and pages are class instances. The page type also is the connection point between the programming environment and the EPiServer CMS UI. The properties you add to a page type is also the properties you have available to use when you are creating a page template for the page type.

In addition to the list of properties added by the developer all page types implicitly contains a set of built-in properties. These built-in properties are always available for all pages regardless of which page type they are instances of. For a full list of built-in properties please see the documentation for the PageData.Property property.

Page template

A page template is a Web Form (.aspx) that is used to generate output for pages of a give type. A template can be used for more than one page type but a one-to-one connection is the most common approach. Creating a page template is no different from creating a Web Form for any other .NET Web Application, you can use any combination of markup, server controls, code behind logic and more.

A central function of any page template is to access the property values of the page that was requested by the client so that they can be integrated into the output, so how do you accomplish that? This is where the base classes for Web Forms and User Controls come into play.

Within the EPiServer CMS API there is a whole chain of base classes that your Web Form can inherit from, but TemplatePage is by far the most common selection. Inheriting from a class higher up in the chain simply means that some features are unavailable, for example, the on-page editing feature is only available when inheriting from TemplatePage. The corresponding base class for User Controls is UserControlBase.

The TemplatePage inheritance chain

By making your own Web Forms and User Controls inherit from the appropriate base classes within the EPiServer CMS API you gain access to a set of methods and properties that integrate your Web Form with EPiServer CMS. We will not discuss these methods and properties in detail in this article, but we will highlight one of them; the CurrentPage property.

Access to the CurrentPage property is probably the most important benefit you get from inheriting from TemplatePage. You will find yourself accessing this property many times when you are writing Web Forms and User Controls for an EPiServer CMS project. So what is it? The type of the CurrentPage property is EPiServer.Core.PageData. A PageData object is the programmatical representation of a page in EPiServer, it contains all the property values, access rights etc.. The value of CurrentPage is automatically set to the PageData object that is reqeusted by the client. This means that you don't have to find out what page you should be fetching property values from yourself, all you need to do is consume the property values from the CurrentPage object.

Page

The page is where the page type and the page template comes together. The editor creates the page and sets the values for the properties defined by the page's page type. When the page is requested by a visitor the page template will be used to create the output to be sent to the client.

Summary