November Happy Hour will be moved to Thursday December 5th.

Class ContentTypeAttribute

The attribute class used to identify content types.

Inheritance
System.Object
ContentTypeAttribute
Namespace: EPiServer.DataAnnotations
Assembly: EPiServer.dll
Version: 12.0.3
Syntax
public class ContentTypeAttribute : Attribute
Remarks

Refer to "Attributes" and "Pages, Page Types and Page Templates" under "Content" in the Developer Guide for more information and examples.

Constructors

ContentTypeAttribute()

Declaration
public ContentTypeAttribute()

Properties

AvailableInEditMode

Gets or sets wether the corresponding ContentType is available in edit mode.

Declaration
public bool AvailableInEditMode { get; set; }
Property Value
Type Description
System.Boolean

true if the ContentType is available in edit mode; otherwise, false. Default value is true.

Remarks

Use GetAvailableInEditMode() to check if a value has been assigned.

This setting only affects if a type should be available to create in edit mode, it could still be available to edit if it has already been created or if a block is part of a page.

Description

Gets or sets the Description for the corresponding ContentType.

Declaration
public string Description { get; set; }
Property Value
Type Description
System.String

The description.

DisplayName

Gets or sets the DisplayName for the corresponding ContentType.

Declaration
public string DisplayName { get; set; }
Property Value
Type Description
System.String

The name.

GroupName

Gets or sets a value that is used to group fields.

Declaration
public string GroupName { get; set; }
Property Value
Type Description
System.String

The name of the group.

GUID

Gets or sets the unique id for the corresponding ContentType.

Declaration
public string GUID { get; set; }
Property Value
Type Description
System.String

The unique id of the ContentType. Default value is null.

Remarks

Use GetGUID() to check if a value has been assigned.

Order

Gets or sets the Order for the corresponding ContentType.

Declaration
public int Order { get; set; }
Property Value
Type Description
System.Int32

The sort order or the ContentType, default value is 0.

Remarks

Use GetOrder() to check if a value has been assigned.

Methods

GetAvailableInEditMode()

Returns the nullable bool for the corresponding property AvailableInEditMode.

Declaration
public Nullable<bool> GetAvailableInEditMode()
Returns
Type Description
System.Nullable<System.Boolean>
Remarks

If the usage of the attribute has not set the AvailableInEditMode property this will not have any value.

GetGUID()

Returns the nullable Guid for the corresponding property GUID.

Declaration
public Nullable<Guid> GetGUID()
Returns
Type Description
System.Nullable<System.Guid>
Remarks

If the usage of the attribute has not set the GUID property this will not have any value.

GetOrder()

Returns the nullable int for the corresponding property Order.

Declaration
public Nullable<int> GetOrder()
Returns
Type Description
System.Nullable<System.Int32>
Remarks

If the usage of the attribute has not set the Order property this will not have any value.

Extension Methods