Click or drag to resize

IAssetItemIsDescendantOf Method


Checks whether the specified Asset Folder is an ancestor of the context asset item.

Namespace:  Ingeniux.CMS
Assembly:  Ingeniux.CMS.CSAPI (in Ingeniux.CMS.CSAPI.dll) Version: 10.6.308
Syntax
bool IsDescendantOf(
	IAssetFolder ancestorFolder
)

Parameters

ancestorFolder
Type: Ingeniux.CMSIAssetFolder
The given potential ancestor folder to check against.

Return Value

Type: Boolean
Count of ancestor folders.
Examples
Example of checking if an asset is a descendant of a specific folder in a custom hook:
C#
var viewsFolder = session.Site.AssetFolder("af/113");
if(viewsFolder != null && contentItem.IsDescendantOf(viewsFolder){
    //Additional Actions
}
See Also