Search Results for

    Show / Hide Table of Contents
    View Source

    Interface IContentTypeBase

    Defines the base for a ContentType with properties that are shared between ContentTypes and MediaTypes.

    Namespace: Umbraco.Cms.Core.Models
    Assembly: Umbraco.Core.dll
    Syntax
    public interface IContentTypeBase : IUmbracoEntity, ITreeEntity, IEntity, IDeepCloneable, IRememberBeingDirty, ICanBeDirty

    Properties

    View Source

    Alias

    Gets or Sets the Alias of the ContentType

    Declaration
    string Alias { get; set; }
    Property Value
    Type Description
    System.String
    View Source

    AllowedAsRoot

    Gets or Sets a boolean indicating whether this ContentType is allowed at the root

    Declaration
    bool AllowedAsRoot { get; set; }
    Property Value
    Type Description
    System.Boolean
    View Source

    AllowedContentTypes

    Gets or Sets a list of integer Ids of the ContentTypes allowed under the ContentType

    Declaration
    IEnumerable<ContentTypeSort>? AllowedContentTypes { get; set; }
    Property Value
    Type Description
    System.Nullable<IEnumerable<ContentTypeSort>>
    View Source

    Description

    Gets or Sets the Description for the ContentType

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

    Icon

    Gets or sets the icon for the content type. The value is a CSS class name representing the icon (eg. icon-home) along with an optional CSS class name representing the color (eg. icon-blue). Put together, the value for this scenario would be icon-home color-blue. If a class name for the color isn't specified, the icon color will default to black.

    Declaration
    string Icon { get; set; }
    Property Value
    Type Description
    System.String
    View Source

    IsContainer

    Gets or Sets a boolean indicating whether this ContentType is a Container

    Declaration
    bool IsContainer { get; set; }
    Property Value
    Type Description
    System.Boolean
    Remarks

    ContentType Containers doesn't show children in the tree, but rather in grid-type view.

    View Source

    IsElement

    Gets or sets a value indicating whether this content type is for an element.

    Declaration
    bool IsElement { get; set; }
    Property Value
    Type Description
    System.Boolean
    Remarks

    By default a content type is for a true media, member or document, but it can also be for an element, ie a subset that can for instance be used in nested content.

    View Source

    NoGroupPropertyTypes

    Gets or sets the local property types that do not belong to a group.

    Declaration
    IEnumerable<IPropertyType> NoGroupPropertyTypes { get; set; }
    Property Value
    Type Description
    IEnumerable<IPropertyType>
    View Source

    PropertyGroups

    Gets or sets the local property groups.

    Declaration
    PropertyGroupCollection PropertyGroups { get; set; }
    Property Value
    Type Description
    PropertyGroupCollection
    View Source

    PropertyTypes

    Gets all local property types all local property groups or ungrouped.

    Declaration
    IEnumerable<IPropertyType> PropertyTypes { get; }
    Property Value
    Type Description
    IEnumerable<IPropertyType>
    View Source

    Thumbnail

    Gets or Sets the Thumbnail for the ContentType

    Declaration
    string Thumbnail { get; set; }
    Property Value
    Type Description
    System.String
    View Source

    Variations

    Gets or sets the content variation of the content type.

    Declaration
    ContentVariation Variations { get; set; }
    Property Value
    Type Description
    ContentVariation

    Methods

    View Source

    AddPropertyGroup(String, String)

    Adds a property group with the specified name and alias.

    Declaration
    bool AddPropertyGroup(string alias, string name)
    Parameters
    Type Name Description
    System.String alias

    The alias.

    System.String name

    Name of the group.

    Returns
    Type Description
    System.Boolean

    Returns true if a property group with specified alias was added; otherwise, false .

    Remarks

    This method will also check if a group already exists with the same alias.

    View Source

    AddPropertyType(IPropertyType)

    Adds a PropertyType, which does not belong to a PropertyGroup.

    Declaration
    bool AddPropertyType(IPropertyType propertyType)
    Parameters
    Type Name Description
    IPropertyType propertyType

    IPropertyType to add

    Returns
    Type Description
    System.Boolean

    Returns True if PropertyType was added, otherwise False

    View Source

    AddPropertyType(IPropertyType, String, String)

    Adds the property type to the specified property group (creates a new group if not found and a name is specified).

    Declaration
    bool AddPropertyType(IPropertyType propertyType, string propertyGroupAlias, string propertyGroupName = null)
    Parameters
    Type Name Description
    IPropertyType propertyType

    The property type to add.

    System.String propertyGroupAlias

    The alias of the property group to add the property type to.

    System.String propertyGroupName

    The name of the property group to create when not found.

    Returns
    Type Description
    System.Boolean

    Returns true if the property type was added; otherwise, false.

    View Source

    MovePropertyType(String, String)

    Moves a PropertyType to a specified PropertyGroup

    Declaration
    bool MovePropertyType(string propertyTypeAlias, string propertyGroupAlias)
    Parameters
    Type Name Description
    System.String propertyTypeAlias

    Alias of the PropertyType to move

    System.String propertyGroupAlias

    Alias of the PropertyGroup to move the PropertyType to

    Returns
    Type Description
    System.Boolean
    View Source

    PropertyTypeExists(String)

    Checks whether a PropertyType with a given alias already exists

    Declaration
    bool PropertyTypeExists(string alias)
    Parameters
    Type Name Description
    System.String alias

    Alias of the PropertyType

    Returns
    Type Description
    System.Boolean

    Returns True if a PropertyType with the passed in alias exists, otherwise False

    View Source

    RemovePropertyGroup(String)

    Removes a property group from the current content type.

    Declaration
    void RemovePropertyGroup(string alias)
    Parameters
    Type Name Description
    System.String alias

    Alias of the PropertyGroup to remove

    View Source

    RemovePropertyType(String)

    Removes a PropertyType from the current ContentType

    Declaration
    void RemovePropertyType(string alias)
    Parameters
    Type Name Description
    System.String alias

    Alias of the IPropertyType to remove

    View Source

    SupportsPropertyVariation(String, String, Boolean)

    Validates that a combination of culture and segment is valid for the content type properties.

    Declaration
    bool SupportsPropertyVariation(string culture, string segment, bool wildcards = false)
    Parameters
    Type Name Description
    System.String culture

    The culture.

    System.String segment

    The segment.

    System.Boolean wildcards

    A value indicating whether wildcard are supported.

    Returns
    Type Description
    System.Boolean

    True if the combination is valid; otherwise false.

    Remarks

    The combination must be valid for properties of the content type. For instance, if the content type varies by culture, then an invariant culture is valid, because some properties may be invariant. On the other hand, if the content type is invariant, then a variant culture is invalid, because no property could possibly vary by culture.

    View Source

    SupportsVariation(String, String, Boolean)

    Validates that a combination of culture and segment is valid for the content type.

    Declaration
    bool SupportsVariation(string culture, string segment, bool wildcards = false)
    Parameters
    Type Name Description
    System.String culture

    The culture.

    System.String segment

    The segment.

    System.Boolean wildcards

    A value indicating whether wildcard are supported.

    Returns
    Type Description
    System.Boolean

    True if the combination is valid; otherwise false.

    Remarks

    The combination must match the content type variation exactly. For instance, if the content type varies by culture, then an invariant culture would be invalid.

    View Source

    ToSimple()

    Gets an ISimpleContentType corresponding to this content type.

    Declaration
    ISimpleContentType ToSimple()
    Returns
    Type Description
    ISimpleContentType
    • Improve this Doc
    • View Source
    In This Article
    • Properties
      • Alias
      • AllowedAsRoot
      • AllowedContentTypes
      • Description
      • Icon
      • IsContainer
      • IsElement
      • NoGroupPropertyTypes
      • PropertyGroups
      • PropertyTypes
      • Thumbnail
      • Variations
    • Methods
      • AddPropertyGroup(String, String)
      • AddPropertyType(IPropertyType)
      • AddPropertyType(IPropertyType, String, String)
      • MovePropertyType(String, String)
      • PropertyTypeExists(String)
      • RemovePropertyGroup(String)
      • RemovePropertyType(String)
      • SupportsPropertyVariation(String, String, Boolean)
      • SupportsVariation(String, String, Boolean)
      • ToSimple()
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX