Hello,
I got some troubles with the Navigation class.
I explain now my goal: I have a content tree like this
Root Lev 1 Lev 2 etc...
Admin
Host
Pag 1 Pag 1.1
Pag 1.2
Pag 1.3 Pag 1.3.1
Pag 2 .....
and so on.
Top level pages have a redirect to default pages of the section, (such as Pag 1 redirects to Pag 1.1) and default page of the site is one of these (for instance, Pag 1.1)
I need to display a menu that shows the level 1 pages of the current navigation tree (for example, if I am in Pag 1.1, Pag 1.1.2 .... it will show Pag 1.1, Pag. 1.2 ...)
My idea was that: get the Node of the current page, go back util i reach the level 0 parent and display the information of his children.
Unfortunatly i get an error in the behind code:
DNNNodeCollection d = Navigation.GetNavigationNodes("");
DNNNode pagenode;
pagenode = d.FindNode(TabController.CurrentPage.TabID.ToString());
DNNNode currentRoot = pagenode;
while (currentRoot.Level > 0) currentRoot = currentRoot.ParentNode;
d = currentRoot.DNNNodes;
foreach (DNNNode node in d)
{ // do something}
Sometimes (and I don't understend exactly when or why) Navigation.GetNavigationNodes(""); returns a collection with no elements.
I don't get how to retrieve th DNNNode of the current page directly, so I use the Navigation.GetNavigationNodes("") to get the level 0 nodes and search thecurrent node between their children
Someone could help me with this?
thank you all
Alex