Click or drag to resize

IAssetItemAncestorFoldersCount Method


Gets the count of ancestor asset folders of the context asset item.

Namespace:  Ingeniux.CMS
Assembly:  Ingeniux.CMS.CSAPI (in Ingeniux.CMS.CSAPI.dll) Version: 10.3.169
Syntax
int AncestorFoldersCount()

Return Value

Type: Int32
Count of ancestor asset folders.
Remarks
If the asset item is the Assets Tree root, returns empty collection.
Examples
Example of checking the folder depth in OnNew custom hook:
C#
if(contentItem.AncestorFoldersCount() > 5){
    //Additional Logic
}
See Also