What Are Content Types?
Content Types are C# classes that define the structure and metadata of content in Optimizely. They are the building blocks that content editors interact with in the CMS UI.
Each content type:
– Maps to a piece of content (like a page or a block)
– Defines the fields (properties) editors fill out
– Is decorated with attributes to control behavior and appearance
Types of Content Types in optimizely
Types of Content Types in optimizely
Optimizely CMS supports several types of content types. The two most common are:
1. Page Types:
– Represent full web pages
– Have URLs
– Often used to structure the site tree (like HomePage, ArticlePage, ContactPage)
Example:
- Block Types:
– Reusable content chunks
– Do not have their own URL
– Can be placed into content areas or other blocks/pagesExample:
How to Create a Content Type
Creating a content type involves:
1. Creating a class inheriting from PageData or BlockData
2. Decorating it with [ContentType]
3. Adding public properties with appropriate data types and [Display] attributes
The CMS automatically picks up these types via reflection and generates UI elements for editors.
Best Practices for Content Types
Here are some tips to manage content types effectively:
– Use folders: Organize content types in folders like Pages, Blocks, Media, etc.
– Use clear naming conventions: e.g., ArticlePage, ContactFormBlock
– Group properties logically: Use the GroupName property in the [Display] attribute
– Use base classes: Share common properties across types using base classes like SitePageData
– Avoid bloated types: Keep types focused. Use blocks to separate reusable UI components
Testing & Debugging Content Types
– After creating or editing a content type, build the solution and restart the site.
– Optimizely will update the content definitions and make them available in the CMS UI.
– Use the CMS Admin UI (/episerver) to verify and test content entry.
Conclusion
Content Types in Optimizely form the foundation of how content is structured, managed, and rendered. By understanding the distinction between Page Types and Block Types, and by following best practices, you can create a clean, scalable, and user-friendly content model.
Whether you’re building a simple corporate site or a complex digital experience platform, mastering content types is key to success in Optimizely CMS.




