Skip to content

IContent Interface Reference

intermediate
📜Corecms

IContent is the base interface for all content items in Optimizely CMS. Every page, block, media file, and folder implements this interface. When you work with the content API, you interact with IContent and its derived interfaces.

IContent
├── IContentData → Base data contract
├── ILocalizable → Language support
├── IVersionable → Version tracking
├── IChangeTrackable → Created/modified dates
└── ICategorizable → Category assignment
└── PageData → Pages with URLs
└── BlockData → Embeddable blocks
└── MediaData → Files and images
PropertyTypeDescription
ContentLinkContentReferenceUnique identifier for this content version
ContentGuidGuidPermanent GUID that persists across versions
ContentTypeIDintID of the content type definition
ParentLinkContentReferenceReference to the parent content item
NamestringDisplay name of the content item
IsDeletedboolWhether the item is in the trash
PropertyTypeDescription
StatusVersionStatusDraft, Published, PreviouslyPublished, Rejected, CheckedOut, DelayedPublish
StartPublishDateTime?When the content becomes visible
StopPublishDateTime?When the content expires
IsPendingPublishboolWhether scheduled for future publish
PropertyTypeDescription
CreatedDateTimeWhen the content was first created
ChangedDateTimeWhen the content was last modified
SavedDateTimeWhen the content was last saved
CreatedBystringUsername who created the content
ChangedBystringUsername who last modified
PropertyTypeDescription
LanguageCultureInfoLanguage of this content version
MasterLanguageCultureInfoThe original language
ExistingLanguagesIEnumerable<CultureInfo>All available language versions
var content = _contentLoader.Get<IContent>(contentLink);
var page = _contentLoader.Get<ArticlePage>(contentLink);
if (content is PageData page) { /* page-specific logic */ }
if (content is BlockData block) { /* block-specific logic */ }
var children = _contentLoader.GetChildren<PageData>(parentLink);
var ancestors = _contentLoader.GetAncestors(contentLink);