/// <summary> /// Render rootCatalog control to the output parameter specified. /// </summary> /// <param name="output"> The HTML writer to write out to </param> protected override void Render(HtmlTextWriter output) { // _siteMap.RenderControl(output); // if(this._cached) // { output.Write(SiteMapCacheControl.GetSiteMap(this._catalogID, this._linkFormat).Output); // } // else // { // Change the selected item if it doesn't match the current clips item id // if(_siteMap.SelectedItem != null && _siteMap.SelectedItem.ID != _clipID.ToString()) // recurseSelection(_siteMap); // // _siteMap.RenderControl(output); // } }
protected override void CreateChildControls() { if (SiteMapCacheControl.SiteMapExists(this._catalogID, this._linkFormat)) { _cached = true; } else { _siteMap = new SiteMap(); _siteMap.ID = this.ID + "_siteMap"; _siteMap.SiteMapLayout = SiteMapLayoutType.Tree; _siteMap.TreeShowLines = true; _siteMap.TreeLineImagesFolderUrl = "/images/lines2"; _siteMap.TreeLineImageWidth = 19; _siteMap.TreeLineImageHeight = 20; _siteMap.CssClass = "SiteMap"; _siteMap.RootNodeCssClass = "RootNode"; _siteMap.ParentNodeCssClass = "ParentNode"; _siteMap.LeafNodeCssClass = "LeafNode"; _siteMap.Width = this._width; SiteMapTable t = _siteMap.Table; SiteMapTableRow a = new SiteMapTableRow(); SiteMapTableCell a1 = new SiteMapTableCell(); a1.RootNodes = 2; a1.VerticalAlign = VerticalAlign.Top; a.Cells.Add(a1); SiteMapTableCell a2 = new SiteMapTableCell(); a2.RootNodes = 2; a2.VerticalAlign = VerticalAlign.Top; a.Cells.Add(a2); SiteMapTableCell a3 = new SiteMapTableCell(); a3.VerticalAlign = VerticalAlign.Top; a.Cells.Add(a3); t.Rows.Add(a); Controls.Add(_siteMap); } ChildControlsCreated = true; }
protected override void OnLoad(EventArgs e) { EnsureChildControls(); // Cached menus are already Loaded if (_cached) { return; } DbContentCatalog rootCatalog; // CssInfo rootCssInfo; // Load the catalog to start building a menu from rootCatalog = new DbContentCatalog(_catalogID); DbContentCatalogCollection catalogs = rootCatalog.GetCatalogs();; catalogs.Sort(ContentCompareKey.MenuOrder); for (int catalogIndex = 0; catalogIndex < catalogs.Count; catalogIndex++) { addCatalogToSiteMap(_siteMap.Nodes, rootCatalog, catalogs[catalogIndex]); } DbContentClipCollection clips = rootCatalog.GetClips(); clips.Sort(ContentCompareKey.MenuOrder); addClipsToSiteMap(_siteMap.Nodes, rootCatalog, rootCatalog, clips); _siteMap.Width = _width; SiteMapCacheControl.SetSiteMap(_catalogID, _linkFormat, _siteMap); }