Click or drag to resize

IAssetItemAncestorFolders Method


Retrieves a collection of Asset Folders that make up the ancestors of the context asset item.

Namespace:  Ingeniux.CMS
Assembly:  Ingeniux.CMS.CSAPI (in Ingeniux.CMS.CSAPI.dll) Version: 10.3.169
Syntax
IEnumerable<IAssetFolder> AncestorFolders(
	IHierarchyId rootHierarchy = null
)

Parameters

rootHierarchy (Optional)
Type: Ingeniux.CMSIHierarchyId
Optional Hierarchy ID to be treated as the root of the ancestry call. The call will not include any folders above the root.

Return Value

Type: IEnumerableIAssetFolder
Collection of asset folders.
Examples
Example of checking ancestor folders in OnBeforeDelete custom hook:
C#
if(contentItem.AncestorFolder.Any(f => f.Name == "views"){
    //Additional Actions
}
See Also