Hello.
I did not find such a method in our API, however you can use custom macro or custom function in transformation (both is described in our
Developer's guide).
The method itself can do something similar to:
public int CountChildDocs()
{
System.Data.DataSet ds = null;
// create a TreeProvider instance
UserInfo ui = UserInfoProvider.GetUserInfo(CMS.CMSHelper.CMSContext.CurrentUser.UserName);
CMS.TreeEngine.TreeProvider tree = new CMS.TreeEngine.TreeProvider(ui);
// get dataset of tree nodes specified by alias path and class names (separated by semicolon).
ds = tree.SelectNodes("CorporateSite", CMS.CMSHelper.CMSContext.CurrentAliasPath + "/%", "en-us", true, "cms.menuitem");
return ds.Tables[0].Columns.Count;
}
You can find more info about SelectNodes() method and its parameters in our API reference file.
Best Regards,
Radek Macalik