Forum


HomeHomePremiumPremiumDevelopmentDevelopmentDDR Menu - Hide Current SectionDDR Menu - Hide Current Section
Previous
 
Next
New Post
4/7/2014 8:23 AM
 

I am trying to figure out how to create a menu that displays the top level children of the root.  The one requirement is that if you are on a child page, whatever node that page is contained under should not show.

My site is structured:

  • Root
    •    Section 1
      •          S1 child page 1
      •          S1 child page 2
      •          S1 child page 3
      •          S1 child page 5
    •   Section 2
      •          S2 child page 1
      •          s2 child page 2
      •          S2 child page 4
    •   Section 3
      •          S3 child page 1
      •          S3 child  page 2
      •          S3 child page 3
      •          S3 child page 5
    •   Section 4
      •          S4 child page 1
      •          S4 child page 2
      •          S4 child page 3
      •          S4 child page 5

I am currently using a DDR Menu designed with a Razor Template.  I easily create a menu that displays the children of the root.  Using the structure above the menu contains Section 1, Section 2, Section 3, Section 4.  http://www.dnnsoftware.com/wiki/page/ddrmenu-razor-templates is the basic example I started with.

The difficulty I am having is figuring out how to hide the current section.  If I am on the page, Section1.aspx, I can check the node.Selected property and choose not to print the item "Section 1".  I can traverse the node structure and determine if any children are selected.  The problem is with pages that are not represented in the menu.  Say the user is on the page "S4 child page 4".  As you can see in the structure above, it is not part of the menu so a traversal of child nodes would not find the selected item.

I could create a separate Razor template for each section that ignores itself but I would rather have one template that can be used for all sections for easier maintenance.  Any suggestions?

 
New Post
4/7/2014 10:04 AM
 

Hi Andy,

I haven't done this much with DDR menu, but you might find some good info in the DDR tutorial that Armand Datema has published sometime ago:

Beginning XSLT with DDRMenu

It is a 3 part series. Whenever I need a refresher on DDR I check it out.

Cheers,

Aderson

 
New Post
4/7/2014 1:52 PM
 

Even with Razor capabilities, this may not be easily possible in the template. 

The best solution turned out to be:  Make a skin file for each section and use the "ExcludeNode" option of the DDR Menu to specify the PageID for the section that should not be displayed. 

 
New Post
4/8/2014 4:37 AM
 

Yes, I have done DDR menus using the skin token and xslt. I used the NodeSelector attribute of DDR menu to select the node I want to start from, whether to show it and how many children to show.

http://www.dnnsoftware.com/wiki/page/ddrmenu-reference-guide  

NodeSelector="0,1,1" 

The above expression I believe would select current page as root, skip showing that node, and show current children.

 
New Post
4/8/2014 6:15 AM
 

Good to find someone actively / knowledgeably using DDR menu.

Although I can't answer the original question, may I ask how you change the display properties of the active node?

Although we use it on our site but have yet to discover all of its ability, and would to learn a bit more..

Cheers

 
Previous
 
Next
HomeHomePremiumPremiumDevelopmentDevelopmentDDR Menu - Hide Current SectionDDR Menu - Hide Current Section



Try FREE
30 days money back guaranteed