Technical support This forum is closed.
Version 1.x > Technical support > Secondary Menu View modes: 
User avatar
Member
Member
mbuckley - 1/31/2006 5:48:05 AM
   
Secondary Menu
I would like to setup a seperate section menu. For example, if I have a top level menu with a menu called "Menu 1" and I create 2 sub pages under this menu "Sub 1" and "Sub 2". How can I display these sub menus in another menu dynamically based on which top level navigation item that was clicked on?


I have tried the ListMenu
<cc1:CMSListMenu id="Vertical1" runat="server" SelectNodesMaxRelativeLevel="3" SelectNodesPath="/Menu 1/%"
SelectNodesPathType="NamePath"></cc1:CMSListMenu>

This works but is not ideal, as I have to hard code "SelectNodesPath="/Menu 1/%". Is there any way to dynamically populate the "Menu 1" bit depending on which top level item was clicked on?

Thanks,

Mike

User avatar
Guest
admin - 1/31/2006 8:21:28 AM
   
Re: Secondary Menu
Hi Mike,

you need to add a code like this to your Page_Load method:

Vertical1.SelectNodesPath = Functions.GetPathLevel(Functions.GetAliasPath(), 1) + "/%";

The GetPathLevel method returns the first N parts of the current alias path (current position on the web site). In this case, it will return "/Menu 1".

Please let me know if you need more details.

Best Regards,

User avatar
Member
Member
mbuckley - 1/31/2006 6:11:52 PM
   
Re: Secondary Menu
Works great.

Thanks!