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.308
Syntax IEnumerable<IAssetFolder> AncestorFolders(
IHierarchyId rootHierarchy = null
)
Function AncestorFolders (
Optional rootHierarchy As IHierarchyId = Nothing
) As IEnumerable(Of IAssetFolder)
IEnumerable<IAssetFolder^>^ AncestorFolders(
IHierarchyId^ rootHierarchy = nullptr
)
abstract AncestorFolders :
?rootHierarchy : IHierarchyId
(* Defaults:
let _rootHierarchy = defaultArg rootHierarchy null
*)
-> IEnumerable<IAssetFolder>
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:
IEnumerableIAssetFolderCollection of asset folders.
Examples
Example of checking ancestor folders in OnBeforeDelete custom hook:
if(contentItem.AncestorFolder.Any(f => f.Name == "views"){
}
See Also