Interface IContent
Represents a document.
Namespace: Umbraco.Cms.Core.Models
Assembly: Umbraco.Core.dll
Syntax
public interface IContent : IContentBase, IUmbracoEntity, ITreeEntity, IEntity, IDeepCloneable, IRememberBeingDirty, ICanBeDirty
Remarks
A document can be published, rendered by a template.
Properties
View SourceBlueprint
Gets a value indicating whether the content item is a blueprint.
Declaration
bool Blueprint { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Edited
Gets a value indicating whether the content has been edited.
Declaration
bool Edited { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
Will return true once unpublished edits have been made after the version with
PublishedVersionId has been published.
EditedCultures
Gets the edited cultures.
Declaration
IEnumerable<string>? EditedCultures { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<IEnumerable<System.String>> |
PublishCultureInfos
Gets the published culture infos of the content.
Declaration
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.
PublishDate
Gets the date and time the content was published.
Declaration
DateTime? PublishDate { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<DateTime> |
Published
Gets a value indicating whether the content is published.
Declaration
bool Published { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
The PublishedVersionId property tells you which version of the content is currently published.
PublishedCultures
Gets the published cultures.
Declaration
IEnumerable<string> PublishedCultures { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<System.String> |
PublishedState
Declaration
PublishedState PublishedState { get; set; }
Property Value
| Type | Description |
|---|---|
| PublishedState |
PublishedVersionId
Gets the version identifier for the currently published version of the content.
Declaration
int PublishedVersionId { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
PublisherId
Gets the identifier of the user who published the content.
Declaration
int? PublisherId { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.Int32> |
PublishName
Gets the name of the published version of the content.
Declaration
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.
PublishTemplateId
Gets the template id used to render the published version of the content.
Declaration
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.
TemplateId
Gets or sets the template id used to render the content.
Declaration
int? TemplateId { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.Int32> |
Methods
View SourceDeepCloneWithResetIdentities()
Creates a deep clone of the current entity with its identity/alias and it's property identities reset
Declaration
IContent DeepCloneWithResetIdentities()
Returns
| Type | Description |
|---|---|
| IContent |
GetPublishDate(String)
Gets the date a culture was published.
Declaration
DateTime? GetPublishDate(string culture)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | culture |
Returns
| Type | Description |
|---|---|
| System.Nullable<DateTime> |
GetPublishName(String)
Gets the name of the published version of the content for a given culture.
Declaration
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.
IsCultureEdited(String)
Gets a value indicated whether a given culture is edited.
Declaration
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).
IsCulturePublished(String)
Gets a value indicating whether a culture is published.
Declaration
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).