Table of Contents

Interface IPublishing

Namespace
ToSic.Sxc.Data
Assembly
ToSic.Sxc.dll

Publishing Information for ITypedItems.

[WorkInProgressApi("WIP v17")]
public interface IPublishing

Remarks

New v17

Properties

HasBoth

True if this item branches meaning it has a published version and an unpublished draft version.

bool HasBoth { get; }

Property Value

bool

HasPublished

True if this item has a published version. Note that this is also true if the current item is the published version.

bool HasPublished { get; }

Property Value

bool

HasUnpublished

True if this item has an unpublished version. Note that this is also true if the current item is the unpublished version.

bool HasUnpublished { get; }

Property Value

bool

IsSupported

Informs you if the current Item support publishing. Basically all real Items based on IEntity support publishing, but in some cases you will have ITypedItems which are not based on an entity, and those will not support publishing.

By default, those objects will say IsPublished == true and IsUnpublished == false.

bool IsSupported { get; }

Property Value

bool

Methods

GetOpposite()

Get the opposite version of this item. So if your initial item was published, it will try to get the unpublished, and vice versa.

ITypedItem GetOpposite()

Returns

ITypedItem

the other version of this item or null

GetPublished()

Get the published version of this item. If the initial item was already published, it will return that item.

ITypedItem GetPublished()

Returns

ITypedItem

the published item or null

GetUnpublished()

Get the unpublished version of this item. If the initial item was already unpublished, it will return that item.

ITypedItem GetUnpublished()

Returns

ITypedItem

the unpublished item or null