public string GetPagePath(int PageId) { PagesDS.PagesRow page = GetPage(PageId); if (page != null) { if (page["Url"] != System.DBNull.Value) { return(WebContext.Root + "/" + page["Url"].ToString()); } if (page["GroupId"] != System.DBNull.Value) { PagesDS.GroupsRow group = GetGroup(page.GroupId); string groupPath = GetGroupPath(group); string pagePath = page.Name.Replace(StringUtils.ToURL(groupPath) + "-", ""); return(groupPath + "/" + pagePath); } return(null); } ErrorContext.Add("page-not-found", new Exception("The Id supplied does not exist")); return(null); }
public string GetGroupPath(PagesDS.GroupsRow group) { string path = group.Path; if (group["Parent"] != System.DBNull.Value) { return(GetGroupPath(GetGroup(group.Parent)) + "/" + path); } return(path); }