IAssetItemAncestorFolders Method
|
Retrieves a collection of
Asset Folders that make up the ancestors of the context asset item.
Namespace: Ingeniux.CMSAssembly: Ingeniux.CMS.CSAPI (in Ingeniux.CMS.CSAPI.dll) Version: 10.6.492
SyntaxIEnumerable<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 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
IEnumerableIAssetFolderCollection of asset folders.
Example
Example of checking ancestor folders in OnBeforeDelete custom hook:
if(contentItem.AncestorFolder.Any(f => f.Name == "views"){
}
See Also