I have a 'Products' page which will have a load of sub pages to represent the products. So, there is a Products node then sub-nodes for each product. I would like to have the sub products permanently display in the left hand web page as a sub navigation. It will behave as though 'Products' is a root node. I'm looking at the 'NavigationLevelTwo' menu which behaves the way I want it to. But instead of using the root node to start from, I want it to start from 'Products' which is a sub node of root. Any idea how to do this?
Here is a reminder of the 'NavigationLevelTwo' class:
Code:
private void Page_Load(object sender, System.EventArgs e)
{
try
{
if (this.Page is PageEngine)
{
this._page = (PageEngine)this.Page;
// Bind level 2 nodes
if (this._page.ActiveNode.Level > 0)
{
this.rptNav2.ItemDataBound += new RepeaterItemEventHandler(rptNav2_ItemDataBound);
this.rptNav2.DataSource = this._page.ActiveNode.NodePath[1].ChildNodes;
this.rptNav2.DataBind();
}
}
}
catch (InvalidCastException ex)
{
throw new Exception("This control requires a Page of the type Cuyahoga.Web.UI.Page.", ex);
}
}
private void rptNav2_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
{
Node node = (Node)e.Item.DataItem;
if (node.ShowInNavigation && node.ViewAllowed(this._page.CuyahogaUser))
{
HyperLink hpl = (HyperLink)e.Item.FindControl("hplNav2");
hpl.NavigateUrl = UrlHelper.GetUrlFromNode(node);
hpl.Text = node.Title;
UrlHelper.SetHyperLinkTarget(hpl, node);
if (node.Level <= this._page.ActiveNode.Level && node.Id == this._page.ActiveNode.Trail[node.Level])
{
hpl.CssClass = "subselected";
}
}
else
{
e.Item.Visible = false;
}
}
Web Developer, Kent - Coolbytes