Search Results for

    Show / Hide Table of Contents
    View Source

    Class Content

    Represents a Content object

    Inheritance
    object
    BeingDirtyBase
    EntityBase
    TreeEntityBase
    ContentBase
    PublishableContentBase
    Namespace: Umbraco.Cms.Core.Models
    Assembly: Umbraco.Core.dll
    Syntax
    [DataContract(IsReference = true)]
    public class Content : PublishableContentBase, IContent, IPublishableContentBase, IContentBase, IUmbracoEntity, ITreeEntity, IEntity, IDeepCloneable, IRememberBeingDirty, ICanBeDirty, ITemplatedContent

    Constructors

    View Source

    Content(string, int, IContentType, int, string?)

    Constructor for creating a Content object

    Declaration
    public Content(string name, int parentId, IContentType contentType, int userId, string? culture = null)
    Parameters
    Type Name Description
    string name

    Name of the content

    int parentId

    Id of the Parent content

    IContentType contentType

    ContentType for the current Content object

    int userId

    The identifier of the user creating the Content object

    string culture

    An optional culture.

    View Source

    Content(string, int, IContentType?, string?)

    Constructor for creating a Content object

    Declaration
    public Content(string name, int parentId, IContentType? contentType, string? culture = null)
    Parameters
    Type Name Description
    string name

    Name of the content

    int parentId

    Id of the Parent content

    IContentType contentType

    ContentType for the current Content object

    string culture

    An optional culture.

    View Source

    Content(string, int, IContentType?, PropertyCollection, string?)

    Constructor for creating a Content object

    Declaration
    public Content(string name, int parentId, IContentType? contentType, PropertyCollection properties, string? culture = null)
    Parameters
    Type Name Description
    string name

    Name of the content

    int parentId

    Id of the Parent content

    IContentType contentType

    ContentType for the current Content object

    PropertyCollection properties

    Collection of properties

    string culture

    An optional culture.

    View Source

    Content(string, IContent, IContentType, int, string?)

    Constructor for creating a Content object

    Declaration
    public Content(string name, IContent parent, IContentType contentType, int userId, string? culture = null)
    Parameters
    Type Name Description
    string name

    Name of the content

    IContent parent

    Parent IContent object

    IContentType contentType

    ContentType for the current Content object

    int userId

    The identifier of the user creating the Content object

    string culture

    An optional culture.

    View Source

    Content(string, IContent, IContentType, string?)

    Constructor for creating a Content object

    Declaration
    public Content(string name, IContent parent, IContentType contentType, string? culture = null)
    Parameters
    Type Name Description
    string name

    Name of the content

    IContent parent

    Parent IContent object

    IContentType contentType

    ContentType for the current Content object

    string culture

    An optional culture.

    View Source

    Content(string, IContent, IContentType, PropertyCollection, string?)

    Constructor for creating a Content object

    Declaration
    public Content(string name, IContent parent, IContentType contentType, PropertyCollection properties, string? culture = null)
    Parameters
    Type Name Description
    string name

    Name of the content

    IContent parent

    Parent IContent object

    IContentType contentType

    ContentType for the current Content object

    PropertyCollection properties

    Collection of properties

    string culture

    An optional culture.

    Properties

    View Source

    Blueprint

    Gets or sets the published state of the content. Gets a value indicating whether the content item is a blueprint.
    Declaration
    [DataMember]
    public bool Blueprint { get; set; }
    Property Value
    Type Description
    bool
    View Source

    PublishTemplateId

    Gets the template id used to render the published version of the content.

    Declaration
    [IgnoreDataMember]
    public int? PublishTemplateId { get; set; }
    Property Value
    Type Description
    int?
    Remarks

    When editing the content, the template can change, but this will not until the content is published.

    View Source

    TemplateId

    Gets or sets the template used by the Content. This is used to override the default one from the ContentType.

    Declaration
    [DataMember]
    public int? TemplateId { get; set; }
    Property Value
    Type Description
    int?
    Remarks

    If no template is explicitly set on the Content object, the Default template from the ContentType will be returned.

    Methods

    View Source

    DeepCloneWithResetIdentities()

    Creates a deep clone of the current entity with its identity/alias and it's property identities reset

    Declaration
    public IContent DeepCloneWithResetIdentities()
    Returns
    Type Description
    IContent
    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX