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.6.492
Syntax
IEnumerable<IAssetFolder> AncestorFolders(
	IHierarchyId rootHierarchy = null
)

Parameters

rootHierarchy  IHierarchyId  (Optional)
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

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