In Optimizely Content Management System (CMS) version 7.0, the content system was introduced with usage of the central types pages and blocks in CMS. Since the CMS 7.5 release, the Optimizely Customized Commerce catalog and Media system is delivered as content.
## UI descriptors
To make content types appear and behave differently, you can use UI Descriptors to describe appearance and behavior of a content type, such as setting the icon used to display items of the type. The following code describes how objects of the custom type `ContainerPage
` behaves in the user interface by specifying the CSS classes used to display the item, such as in listings or trees.
## Inheritance
The type descriptor supports inheritance so that when behavior is not defined on the specific type, it checks parent type descriptors for a description of requested behavior. For example, if a page type does not specify a custom icon then the generic icon for pages is used.
## Sticky view
"Sticky view" means that, when navigating the content tree, the previously used view is loaded instead of the default view. The sticky view functionality is enabled for every content item by default. If the content item should not use sticky view and has it own default view, the `EnableStickyView
` property should be set to false.
Note
You should enable the feature for as many content types as possible or turn it off for all content types. Mixing the true and false flag between content types may make the sticky view behavior seem inconsistent to editors, as there is no way for editors to know if the sticky view is enabled or disabled on a content item.
For example, if CMS should force the all properties view to be the default view for the `StartPage
` type instead of the previously used view, then `EnableStickyView
` should be false and `DefaultView
` should be set to `AllPropertiesView
`.
## Resources
You can add type specific translations for the user interface for creating, moving or deleting items.
The following example sets some generic “fallback” texts for any content, some more specific texts for blocks, and very specific texts for “YouTube blocks” (assuming that this is a type in your solution). It defaults to a language node under “contenttypes” with the name of the type without namespace. You can change the key by defining the `LanguageKey
` property of your type descriptor; for example, if you have classes in different namespaces with the same class name.
## Content repository descriptors
CMS has a content repository descriptors entity to standardize components that show content from repositories. This class describes a repository so that the UI can auto-generate with the settings for a repository. You can create navigation components such as the page tree, or selection widgets such as the page selector. The following example shows how the implementation for the block repository descriptor:
The following example shows how to use the content repository to create a content selector for blocks within the repository:
The following example shows how to set up a component in the assets pane of the CMS main view that shows content from the repository: