IMPORTANT: This version of Sitefinity CMS is out of support and the respective product documentation is no longer maintained and can be outdated. Use the version selector to view a supported product version.
Sitefinity CMS provides you with an API for managing hierarchical items that uses the DynamicContentExtensions public class.
The API consists of extension methods over DynamicContent items:
void SetParent(this DynamicContent dynamicContent, DynamicContent parentItem)
void SetParent(this DynamicContent dynamicContent, Guid parentId, string systemParentType)
void AddChildItem(this DynamicContent parnetItem, DynamicContent childItem)
IQueryable<
DynamicContent
> GetChildItems(this DynamicContent dynamicContent, Type childItemsType)
> GetChildItems(this DynamicContent dynamicContent, string childItemsType)
> GetSuccessors(this DynamicContent dynamicContent, string childItemsType)
> GetSuccessors(this DynamicContent dynamicContent, Type childItemsType)
The child type does not need to be a direct child of the current parent item. If the method is invoked for a Live item, it returns Live child items only, otherwise, it returns items in status Master.
IEnumerable<
> GetChildItems(this DynamicContent dynamicContent, Type childItemsType, string filterExpression, string orderExpression, int? skip, int? take, ref int? totalCount)
> GetChildItems(this DynamicContent dynamicContent, string childItemsType, string filterExpression, string orderExpression, int? skip, int? take, ref int? totalCount)
The method can be used from a custom pager, since it return the total count of the items and accepts skip and take as parameters. If the method is invoked for a Live item, it returns Live child items only, otherwise, it returns items in status Master. If the chidlItemsType is missing, the method returns all child types from type DynamicContent.
int GetChildItemsCount(this DynamicContent parentItem, Type childItemsType)
int GetChildItemsCount(this DynamicContent parentItem, string childItemsType)
bool IsValidParent(this DynamicContent childItem, Type systemParentType)
bool IsValidParent(this DynamicContent childItem, string systemParentType)
bool IsValidPredecessor(this DynamicContent childItem, Type systemParentType)
bool IsValidPredecessor(this DynamicContent childItem, string systemParentType)
Back To Top
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important