/// <summary> /// Gets a list of `SubNav` items under the `Node` passed in. /// </summary> /// <param name="node"></param> /// <returns></returns> public IEnumerable <SubNav> GetSubNavFromAliasPath(string nodeAliasPath, CultureInfo cultureInfo = null, ISiteInfo siteInfo = null) { if (siteInfo == null) { // If site is not provided, get the current site siteInfo = _siteService.CurrentSite; _eventLogService.LogEvent("GetSubNavFromAliasPath", "ExampleService", "GET", "Using current site"); } else { _eventLogService.LogEvent("GetSubNavFromAliasPath", "ExampleService", "GET", "Using passed in site"); } if (cultureInfo == null) { cultureInfo = LocalizationContext.GetCurrentCulture(); _eventLogService.LogEvent("GetSubNavFromAliasPath", "ExampleService", "GET", "Using current culture"); } else { _eventLogService.LogEvent("GetSubNavFromAliasPath", "ExampleService", "GET", "Using passed in culture"); } var subnavList = new List <SubNav>(); try { foreach (ITreeNode Node in DocumentQueryHelper.RepeaterQuery( Path: nodeAliasPath + "/%", CultureCode: cultureInfo.CultureCode, SiteName: siteInfo.SiteName, ClassNames: "CMS.MenuItem", OrderBy: "NodeLevel, NodeOrder", Columns: "MenuItemName,NodeAliasPath" )) { subnavList.Add(new SubNav() { LinkText = Node.GetValue("MenuItemName").ToString(), // You have to decide what your URL will be, for us our URLs = NodeAliasPath LinkUrl = Node.NodeAliasPath }); } } catch (Exception ex) { _eventLogService.LogException("ExampleService", "GET", ex); } return(subnavList); }