Search Results for

    Show / Hide Table of Contents
    View Source

    Class PublishedContentWrapped

    Provides an abstract base class for IPublishedContent implementations that wrap and extend another IPublishedContent.

    Inheritance
    System.Object
    Namespace: Umbraco.Core.Models.PublishedContent
    Assembly: Umbraco.Core.dll
    Syntax
    public abstract class PublishedContentWrapped : IPublishedContent, IPublishedElement

    Constructors

    View Source

    PublishedContentWrapped(IPublishedContent)

    Initialize a new instance of the PublishedContentWrapped class with an IPublishedContent instance to wrap.

    Declaration
    protected PublishedContentWrapped(IPublishedContent content)
    Parameters
    Type Name Description
    IPublishedContent content

    The content to wrap.

    Properties

    View Source

    Children

    Gets the children of the content item that are available for the current culture.

    Declaration
    public virtual IEnumerable<IPublishedContent> Children { get; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<IPublishedContent>
    View Source

    ChildrenForAllCultures

    Gets all the children of the content item, regardless of whether they are available for the current culture.

    Declaration
    public virtual IEnumerable<IPublishedContent> ChildrenForAllCultures { get; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<IPublishedContent>
    View Source

    ContentType

    Gets the content type.

    Declaration
    public virtual IPublishedContentType ContentType { get; }
    Property Value
    Type Description
    IPublishedContentType
    View Source

    CreateDate

    Gets the date the content item was created.

    Declaration
    public virtual DateTime CreateDate { get; }
    Property Value
    Type Description
    System.DateTime
    View Source

    CreatorId

    Gets the identifier of the user who created the content item.

    Declaration
    public virtual int CreatorId { get; }
    Property Value
    Type Description
    System.Int32
    View Source

    CreatorName

    Gets the name of the user who created the content item.

    Declaration
    public virtual string CreatorName { get; }
    Property Value
    Type Description
    System.String
    View Source

    Cultures

    Gets available culture infos.

    Declaration
    public IReadOnlyDictionary<string, PublishedCultureInfo> Cultures { get; }
    Property Value
    Type Description
    System.Collections.Generic.IReadOnlyDictionary<System.String, PublishedCultureInfo>
    Remarks

    Contains only those culture that are available. For a published content, these are the cultures that are published. For a draft content, those that are 'available' ie have a non-empty content name.

    Does not contain the invariant culture.

    // fixme?

    View Source

    Id

    Gets the unique identifier of the content item.

    Declaration
    public virtual int Id { get; }
    Property Value
    Type Description
    System.Int32
    View Source

    ItemType

    Gets the type of the content item (document, media...).

    Declaration
    public virtual PublishedItemType ItemType { get; }
    Property Value
    Type Description
    PublishedItemType
    View Source

    Key

    Gets the unique key of the published element.

    Declaration
    public Guid Key { get; }
    Property Value
    Type Description
    System.Guid
    View Source

    Level

    Gets the tree level of the content item.

    Declaration
    public virtual int Level { get; }
    Property Value
    Type Description
    System.Int32
    View Source

    Name

    Gets the name of the content item for the current culture.

    Declaration
    public virtual string Name { get; }
    Property Value
    Type Description
    System.String
    View Source

    Parent

    Gets the parent of the content item.

    Declaration
    public virtual IPublishedContent Parent { get; }
    Property Value
    Type Description
    IPublishedContent
    Remarks

    The parent of root content is null.

    View Source

    Path

    Gets the tree path of the content item.

    Declaration
    public virtual string Path { get; }
    Property Value
    Type Description
    System.String
    View Source

    Properties

    Gets the properties of the element.

    Declaration
    public virtual IEnumerable<IPublishedProperty> Properties { get; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<IPublishedProperty>
    Remarks

    Contains one IPublishedProperty for each property defined for the content type, including inherited properties. Some properties may have no value.

    View Source

    SortOrder

    Gets the sort order of the content item.

    Declaration
    public virtual int SortOrder { get; }
    Property Value
    Type Description
    System.Int32
    View Source

    TemplateId

    Gets the identifier of the template to use to render the content item.

    Declaration
    public virtual int? TemplateId { get; }
    Property Value
    Type Description
    System.Nullable<System.Int32>
    View Source

    UpdateDate

    Gets the date the content item was last updated.

    Declaration
    public virtual DateTime UpdateDate { get; }
    Property Value
    Type Description
    System.DateTime
    Remarks

    For published content items, this is also the date the item was published.

    This date is always global to the content item, see CultureDate() for the date each culture was published.

    View Source

    Url

    Gets the URL of the content item for the current culture.

    Declaration
    [Obsolete("Use the Url() extension instead")]
    public virtual string Url { get; }
    Property Value
    Type Description
    System.String
    Remarks

    The value of this property is contextual. It depends on the 'current' request uri, if any.

    View Source

    UrlSegment

    Gets the URL segment of the content item for the current culture.

    Declaration
    public virtual string UrlSegment { get; }
    Property Value
    Type Description
    System.String
    View Source

    WriterId

    Gets the identifier of the user who last updated the content item.

    Declaration
    public virtual int WriterId { get; }
    Property Value
    Type Description
    System.Int32
    View Source

    WriterName

    Gets the name of the user who last updated the content item.

    Declaration
    public virtual string WriterName { get; }
    Property Value
    Type Description
    System.String

    Methods

    View Source

    GetProperty(String)

    Gets a property identified by its alias.

    Declaration
    public virtual IPublishedProperty GetProperty(string alias)
    Parameters
    Type Name Description
    System.String alias

    The property alias.

    Returns
    Type Description
    IPublishedProperty

    The property identified by the alias.

    Remarks

    If the content type has no property with that alias, including inherited properties, returns null,

    otherwise return a property -- that may have no value (ie HasValue is false).

    The alias is case-insensitive.

    View Source

    IsDraft(String)

    Gets a value indicating whether the content is draft.

    Declaration
    public virtual bool IsDraft(string culture = null)
    Parameters
    Type Name Description
    System.String culture
    Returns
    Type Description
    System.Boolean
    Remarks

    A content is draft when it is the unpublished version of a content, which may have a published version, or not.

    When retrieving documents from cache in non-preview mode, IsDraft is always false, as only published documents are returned. When retrieving in preview mode, IsDraft can either be true (document is not published, or has been edited, and what is returned is the edited version) or false (document is published, and has not been edited, and what is returned is the published version).

    View Source

    IsPublished(String)

    Gets a value indicating whether the content is published.

    Declaration
    public virtual bool IsPublished(string culture = null)
    Parameters
    Type Name Description
    System.String culture
    Returns
    Type Description
    System.Boolean
    Remarks

    A content is published when it has a published version.

    When retrieving documents from cache in non-preview mode, IsPublished is always true, as only published documents are returned. When retrieving in draft mode, IsPublished can either be true (document has a published version) or false (document has no published version).

    It is therefore possible for both IsDraft and IsPublished to be true at the same time, meaning that the content is the draft version, and a published version exists.

    View Source

    Unwrap()

    Gets the wrapped content.

    Declaration
    public IPublishedContent Unwrap()
    Returns
    Type Description
    IPublishedContent

    The wrapped content, that was passed as an argument to the constructor.

    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • PublishedContentWrapped(IPublishedContent)
    • Properties
      • Children
      • ChildrenForAllCultures
      • ContentType
      • CreateDate
      • CreatorId
      • CreatorName
      • Cultures
      • Id
      • ItemType
      • Key
      • Level
      • Name
      • Parent
      • Path
      • Properties
      • SortOrder
      • TemplateId
      • UpdateDate
      • Url
      • UrlSegment
      • WriterId
      • WriterName
    • Methods
      • GetProperty(String)
      • IsDraft(String)
      • IsPublished(String)
      • Unwrap()
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX