PageTypeBuilder for EPiServer
Apr 18, 2013
PageTypeBuilder, an open source project developed by Joel Abrahamsson is a great tool that helps managing, directly in code, Page Type definitions in EPiServer projects.
As anyone that has worked with EPiServer knows, Page Types are usually managed in the Admin interface, and they do not support advanced features like inheritance. You can use Dynamic Properties to somehow manage content that is shared among different page types in the project, but there isn’t real structural inheritance. Also, to synchronize Page Types between environments (such as when you have your project in a Continuous Integration deployment schema, with environments for Build, QA, Staging, Production, etc.), you have to manually export and import the Page Types in each one, or even worse, copy the entire database from server to server.
PageTypeBuilder easily solves this synchronization issue. All Page Types are defined in code, as any other class in C#. This means that, when you deploy the project to another environment, the Page Types will be automatically synchronized without further intervention. And since they are defined as C# classes, Page Type structure inheritance is as simple as inheriting one Page Type class from another Page Type class. You can even define “Base Page Types” that contain shared data fields; however they aren’t created in the system as actual Page Types. The “concrete” Page Type classes inherit from this Base Page Type class, and implement their own additional fields.
PageTypeBuilder also allows managing Tabs and, since version 2.0, Field Configurations. In upcoming posts, I’ll discuss these features in more detail.
PageTypeBuilder has its disadvantages and limitations. There are not many resources about it in the Internet, but you can always check Joel’s blog for introductions and examples. Also, since it creates the Page Type structures in the project’s database when first accessed, it doesn’t delete fields or Page Types that have been removed from the code. You will have to delete them manually in Admin mode.
Frequently Asked Questions
XM Cloud is a fully-managed self-service platform that allows developers and marketers to efficiently launch engaging omnichannel experiences in the cloud. All of this is achieved using Sitecore’s headless architecture.
Sitecore Azure gives enterprises an interface to manage their cloud delivery infrastructure and simplify deployment to Microsoft Azure.
Related Insights
-
-
Jonathan Saurez
-
Fernando Torres
-
Oshyn
How To Choose a CMS or DXP
Selecting the Optimal Digital Platform for Your Business
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.