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.492
Syntax
bool IsDescendantOf(
	IAssetFolder ancestorFolder
)

Parameters

ancestorFolder  IAssetFolder
The given potential ancestor folder to check against.

Return Value

Boolean
Count of ancestor folders.
Example
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