Skip to content

Content Type Attributes Reference

intermediate
📜Corecms

Registers a class as a CMS content type. Required on all page, block, and media types.

ParameterTypeRequiredDescription
DisplayNamestringYesName shown in the editor UI
GUIDstringYesUnique identifier. Never change after deployment.
DescriptionstringNoHelp text shown when selecting the type
GroupNamestringNoGroups types in the “New page” dialog
OrderintNoSort order within the group
AvailableInEditModeboolNoWhether authors can create instances (default: true)
[ContentType(
DisplayName = "Article Page",
GUID = "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
Description = "A page for publishing articles",
GroupName = "Content",
Order = 100)]
public class ArticlePage : PageData { }

Restricts which content types can be created as children or placed in content areas.

ParameterTypeDescription
IncludeType[]Only these types are allowed
ExcludeType[]These types are blocked (all others allowed)
IncludeOnType[]This type can only be created under these parent types
ExcludeOnType[]This type cannot be created under these parent types
[AvailableContentTypes(Include = new[] { typeof(ArticlePage), typeof(CategoryPage) })]
public class BlogContainer : PageData { }

Sets the thumbnail icon shown in the content type selector.

[ImageUrl("~/icons/article-icon.png")]
public class ArticlePage : PageData { }

Controls how a property appears in the editor form.

ParameterTypeDescription
NamestringLabel shown in the editor
DescriptionstringHelp text below the field
GroupNamestringTab where the property appears
OrderintSort order within the tab
PromptstringPlaceholder text in the input

Makes the property mandatory. Content cannot be published without a value.

Controls whether the property value is included in full-text search.

[Searchable(false)] // Exclude from search index
public virtual string InternalNotes { get; set; }

When true, the property has a separate value per language. When false, the value is shared across all languages.

[CultureSpecific] // Each language has its own value
public virtual string Title { get; set; }
[CultureSpecific(false)] // Same value in all languages
public virtual string ProductSKU { get; set; }

Hides the property from the editing form while keeping it accessible in code.

[ScaffoldColumn(false)]
public virtual string InternalId { get; set; }

Excludes the property from CMS entirely — not stored, not editable.

[Ignore]
public virtual string ComputedField => $"{FirstName} {LastName}";

Overrides the default editor control for a property.

UIHint valueEditor control
UIHint.TextareaMulti-line text area
UIHint.MediaFileMedia file picker
UIHint.ImageImage picker
UIHint.VideoVideo picker
UIHint.BlockBlock picker
[UIHint(UIHint.Textarea)]
public virtual string Summary { get; set; }
[UIHint(UIHint.Image)]
public virtual ContentReference HeroImage { get; set; }

Creates dropdown or checkbox list from a selection factory.

[SelectOne(SelectionFactoryType = typeof(ColorFactory))]
public virtual string Theme { get; set; }
[SelectMany(SelectionFactoryType = typeof(TagFactory))]
public virtual string Tags { get; set; }
AttributeEffect
[Required]Field must have a value
[StringLength(max)]Maximum string length
[StringLength(max, MinimumLength = min)]Min and max length
[Range(min, max)]Numeric range
[RegularExpression(pattern)]Regex validation
[AllowedTypes(typeof(ImageData))]Restricts content reference to specific types