Redakt content models are created as .NET POCO classes in your application codebase. You can change the configuration and behavior of these models by using attributes. This article describes the attributes you can place on your content models on the class level. If you're trying to change the configuration or behavior of individual properties of your model, check out the property attributes article.

Some attributes can be used both on classes and properties, and therefore also appear in the property attributes list.

Attribute list

The following attributes (in alphabetical order) can be applied to content model classes. All attributes are part of the Redakt.ContentManagement.Annotations namespace.

  • AllowAtRoot attribute indicates that this content model can be used for root nodes of a site or asset library.
  • AllowChildren attribute specifies which content models are allowed as child nodes of the current content model in the site or asset library hierarchy.
  • AllowView attribute specifies which views (layouts) can be used with this content model (only applies to page content models).
  • Asset attribute specifies that this content model represents an Asset node contained in an Asset Library node hierarchy.
  • DisplayName attribute specifies the display name for the content model in the back office user interface.
  • DefaultSection attribute specifies the section in the back office user interface that properties without an explicitly defined section will appear in.
  • Folder attribute specifies that this content model represents a Folder node contained in an Asset Library node hierarchy.
  • Icon attribute specifies the icon for the content model in the back office user interface.
  • MediaType attribute specifies the HTTP Content-Type header value that requests to pages of this model return in the response (only applies to page content models).
  • MediaUpload attribute specifies that content with this model can be created directly from media upload in the back office (only applies to asset content models).
  • Page attribute specifies that this content model represents a Page node contained in a Site node hierarchy.
  • Workflow attribute specifies which publication workflow should be enabled for this model.