• Core
  • Infrastructure
  • Web
  • Extensions
Search Results for

    Show / Hide Table of Contents
    View Source

    Class Content

    Represents a Content object

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

    Constructors

    View Source

    Content(String, Int32, IContentType, Int32, 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
    System.String name

    Name of the content

    System.Int32 parentId

    Id of the Parent content

    IContentType contentType

    ContentType for the current Content object

    System.Int32 userId

    The identifier of the user creating the Content object

    System.String culture

    An optional culture.

    View Source

    Content(String, Int32, IContentType, String)

    Constructor for creating a Content object

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

    Name of the content

    System.Int32 parentId

    Id of the Parent content

    IContentType contentType

    ContentType for the current Content object

    System.String culture

    An optional culture.

    View Source

    Content(String, Int32, 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
    System.String name

    Name of the content

    System.Int32 parentId

    Id of the Parent content

    IContentType contentType

    ContentType for the current Content object

    PropertyCollection properties

    Collection of properties

    System.String culture

    An optional culture.

    View Source

    Content(String, IContent, IContentType, Int32, 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
    System.String name

    Name of the content

    IContent parent

    Parent IContent object

    IContentType contentType

    ContentType for the current Content object

    System.Int32 userId

    The identifier of the user creating the Content object

    System.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
    System.String name

    Name of the content

    IContent parent

    Parent IContent object

    IContentType contentType

    ContentType for the current Content object

    System.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
    System.String name

    Name of the content

    IContent parent

    Parent IContent object

    IContentType contentType

    ContentType for the current Content object

    PropertyCollection properties

    Collection of properties

    System.String culture

    An optional culture.

    Properties

    View Source

    Blueprint

    Declaration
    [DataMember]
    public bool Blueprint { get; set; }
    Property Value
    Type Description
    System.Boolean
    View Source

    Edited

    Declaration
    [IgnoreDataMember]
    public bool Edited { get; set; }
    Property Value
    Type Description
    System.Boolean
    View Source

    EditedCultures

    Gets the edited cultures.

    Declaration
    [IgnoreDataMember]
    public IEnumerable<string>? EditedCultures { get; set; }
    Property Value
    Type Description
    System.Nullable<IEnumerable<System.String>>
    View Source

    PublishCultureInfos

    Gets the published culture infos of the content.

    Declaration
    [IgnoreDataMember]
    public ContentCultureInfosCollection PublishCultureInfos { get; set; }
    Property Value
    Type Description
    ContentCultureInfosCollection
    Remarks

    Because a dictionary key cannot be null this cannot get the invariant name, which must be get via the PublishName property.

    View Source

    PublishDate

    Gets the date and time the content was published.

    Declaration
    [IgnoreDataMember]
    public DateTime? PublishDate { get; set; }
    Property Value
    Type Description
    System.Nullable<DateTime>
    View Source

    Published

    Gets or sets a value indicating whether this content item is published or not.

    Declaration
    [DataMember]
    public bool Published { get; set; }
    Property Value
    Type Description
    System.Boolean
    Remarks

    the setter is should only be invoked from

    • the ContentFactory when creating a content entity from a dto
    • the ContentRepository when updating a content entity
    View Source

    PublishedCultures

    Gets the published cultures.

    Declaration
    [IgnoreDataMember]
    public IEnumerable<string> PublishedCultures { get; }
    Property Value
    Type Description
    IEnumerable<System.String>
    View Source

    PublishedState

    Gets the published state of the content item.

    Declaration
    [DataMember]
    public PublishedState PublishedState { get; set; }
    Property Value
    Type Description
    PublishedState
    Remarks

    The state should be Published or Unpublished, depending on whether Published is true or false, but can also temporarily be Publishing or Unpublishing when the content item is about to be saved.

    View Source

    PublishedVersionId

    Declaration
    [IgnoreDataMember]
    public int PublishedVersionId { get; set; }
    Property Value
    Type Description
    System.Int32
    View Source

    PublisherId

    Gets the identifier of the user who published the content.

    Declaration
    [IgnoreDataMember]
    public int? PublisherId { get; set; }
    Property Value
    Type Description
    System.Nullable<System.Int32>
    View Source

    PublishName

    Gets the name of the published version of the content.

    Declaration
    [IgnoreDataMember]
    public string PublishName { get; set; }
    Property Value
    Type Description
    System.String
    Remarks

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

    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
    System.Nullable<System.Int32>
    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
    System.Nullable<System.Int32>
    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 and it's property identities reset

    Declaration
    public IContent DeepCloneWithResetIdentities()
    Returns
    Type Description
    IContent
    View Source

    GetPublishDate(String)

    Gets the date a culture was published.

    Declaration
    public DateTime? GetPublishDate(string culture)
    Parameters
    Type Name Description
    System.String culture
    Returns
    Type Description
    System.Nullable<DateTime>
    View Source

    GetPublishName(String)

    Gets the name of the published version of the content for a given culture.

    Declaration
    public string GetPublishName(string culture)
    Parameters
    Type Name Description
    System.String culture
    Returns
    Type Description
    System.String
    Remarks

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

    When culture is null, gets the invariant language, which is the value of the PublishName property.

    View Source

    IsCultureEdited(String)

    Gets a value indicated whether a given culture is edited.

    Declaration
    public bool IsCultureEdited(string culture)
    Parameters
    Type Name Description
    System.String culture
    Returns
    Type Description
    System.Boolean
    Remarks

    A culture is edited when it is available, and not published or published but with changes.

    A culture can be edited even though the document might now have been saved yet (and can have no identity).

    Does not support the '*' wildcard (returns false).

    View Source

    IsCulturePublished(String)

    Gets a value indicating whether a culture is published.

    Declaration
    public bool IsCulturePublished(string culture)
    Parameters
    Type Name Description
    System.String culture
    Returns
    Type Description
    System.Boolean
    Remarks

    A culture becomes published whenever values for this culture are published, and the content published name for this culture is non-null. It becomes non-published whenever values for this culture are unpublished.

    A culture becomes published as soon as PublishCulture has been invoked, even though the document might not have been saved yet (and can have no identity).

    Does not support the '*' wildcard (returns false).

    View Source

    IsPropertyDirty(String)

    Determines whether a specific property is dirty.

    Declaration
    public override bool IsPropertyDirty(string propertyName)
    Parameters
    Type Name Description
    System.String propertyName
    Returns
    Type Description
    System.Boolean
    Remarks

    Overridden to check special keys.

    View Source

    PerformDeepClone(Object)

    Declaration
    protected override void PerformDeepClone(object clone)
    Parameters
    Type Name Description
    System.Object clone
    View Source

    ResetDirtyProperties(Boolean)

    Declaration
    public override void ResetDirtyProperties(bool rememberDirty)
    Parameters
    Type Name Description
    System.Boolean rememberDirty
    View Source

    ResetWereDirtyProperties()

    Declaration
    public override void ResetWereDirtyProperties()
    View Source

    WasPropertyDirty(String)

    Determines whether a specific property was dirty.

    Declaration
    public override bool WasPropertyDirty(string propertyName)
    Parameters
    Type Name Description
    System.String propertyName
    Returns
    Type Description
    System.Boolean
    Remarks

    Overridden to check special keys.

    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • Content(String, Int32, IContentType, Int32, String)
      • Content(String, Int32, IContentType, String)
      • Content(String, Int32, IContentType, PropertyCollection, String)
      • Content(String, IContent, IContentType, Int32, String)
      • Content(String, IContent, IContentType, String)
      • Content(String, IContent, IContentType, PropertyCollection, String)
    • Properties
      • Blueprint
      • Edited
      • EditedCultures
      • PublishCultureInfos
      • PublishDate
      • Published
      • PublishedCultures
      • PublishedState
      • PublishedVersionId
      • PublisherId
      • PublishName
      • PublishTemplateId
      • TemplateId
    • Methods
      • DeepCloneWithResetIdentities()
      • GetPublishDate(String)
      • GetPublishName(String)
      • IsCultureEdited(String)
      • IsCulturePublished(String)
      • IsPropertyDirty(String)
      • PerformDeepClone(Object)
      • ResetDirtyProperties(Boolean)
      • ResetWereDirtyProperties()
      • WasPropertyDirty(String)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX