Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Troubles with Navigation ClassTroubles with Navigation Class
Previous
 
Next
New Post
12/22/2009 8:49 AM
 

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

 

 


 

 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Troubles with Navigation ClassTroubles with Navigation Class


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out