Class AvailableContentTypesAttribute
Defines which content types that should be available under a ContentType
Inheritance
Inherited Members
Namespace: EPiServer.DataAnnotations
Assembly: EPiServer.dll
Version: 8.11.0Syntax
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
public class AvailableContentTypesAttribute : Attribute, _Attribute, IContentTypeAvailableModelSetting
Remarks
The diffent properties of the attribute are applied in the following way:
- Include implicitly exclude all PageTypes not in the list.
- Exclude implicitly include all PageTypes not in the list.
- IncludeOn and ExcludeOn combine with the settings on the target PageType. If there is a conflict Exclude/ExcludeOn have precedency over Include/IncludeOn.
Refer to "Attributes" and "Pages, Page Types and Page Templates" under "Content" in the Developer Guide for more information and examples.
Examples
Here is an example on how you can set available page types on your page types using this attribute.
Constructors
AvailableContentTypesAttribute()
Initializes a new instance of the AvailableContentTypesAttribute class.
Declaration
public AvailableContentTypesAttribute()
AvailableContentTypesAttribute(Availability)
Initializes a new instance of the AvailableContentTypesAttribute class.
Declaration
public AvailableContentTypesAttribute(Availability availability)
Parameters
Type | Name | Description |
---|---|---|
Availability | availability |
Properties
Availability
Gets or sets wether none ContentType should be available to create under the ContentType that has this attribute set.
Declaration
public Availability Availability { get; set; }
Property Value
Type | Description |
---|---|
Availability |
|
Exclude
Gets or sets the typed pages that are not available under an instance of a page of corresponding PageType.
Declaration
public Type[] Exclude { get; set; }
Property Value
Type | Description |
---|---|
System.Type[] | The available page types. |
ExcludeOn
Will exclude the typed page from the list of available ContentType for the specified typed pages.
Declaration
public Type[] ExcludeOn { get; set; }
Property Value
Type | Description |
---|---|
System.Type[] | The available page types. |
Include
Gets or sets the typed pages that are available under an instance of a page of corresponding ContentType.
Declaration
public Type[] Include { get; set; }
Property Value
Type | Description |
---|---|
System.Type[] | The available page types. |
IncludeOn
Will make the typed page available as child under the specified typed pages.
Declaration
public Type[] IncludeOn { get; set; }
Property Value
Type | Description |
---|---|
System.Type[] | The available page types. |