none
How to create sub-menu in Global-Navigation ?

    Question

  • Hi
    i want to create sub-menu for my sharepoint site like :

    MainMenu > SubMenu > LinkSample1 .... LinkSamplen

    assumming we have two Heading (MainMenu and SubMenu) and multiple link (like LinkSample1). i want place SubMenu underneath of MainMenu to accomplish this, but Headings can not place underneath of another Heading.
    can anybody help me to workaround this problem ?
    thanks
    this is my Signature
    • Moved by Mike Walsh FIN Sunday, August 23, 2009 8:25 AM cust q (From:SharePoint - General Question and Answers and Discussion)
    Saturday, August 22, 2009 10:31 PM

All replies

  • Hi,

    did you try the site navigation in site settings and also enabling sub sites in the navigation properties.
    Saturday, August 22, 2009 10:59 PM
  • Moving to Customization
    WSS FAQ sites: http://wssv2faq.mindsharp.com and http://wssv3faq.mindsharp.com
    Total list of WSS 3.0 / MOSS 2007 Books (including foreign language) http://wssv3faq.mindsharp.com/Lists/v3%20WSS%20FAQ/V%20Books.aspx
    Sunday, August 23, 2009 8:25 AM

  • Out of the box provide your One Level... if you need more sub meun you need to Edit your Master Page and Look for below properties  change your menu

    StaticDisplayLevels–The number of levels of sub navigation to show by default

    MaximumDynamicDisplayLevels–The number of levels of sub-navigation to show as fly-outs

    Orientation–Can be horizontal for top navigation or vertical for side navigation

    Orientation="Horizontal"
    StaticDisplayLevels="1"
    MaximumDynamicDisplayLevels="3" You can go Upto 5 Level sub menu....


     <SharePoint:AspMenu ID="GlobalNav" Runat="server" DataSourceID="SiteMapDataSource1"
      Orientation="Horizontal" StaticDisplayLevels="1" MaximumDynamicDisplayLevels="3"
      StaticSubMenuIndent="0" DynamicHorizontalOffset="0" DynamicVerticalOffset="-8"
      StaticEnableDefaultPopOutImage="false" ItemWrap="false" SkipLinkText="<%$Resources:cms,masterpages_skiplinktext%>" CssClass="topNav">
     
      <StaticMenuItemStyle CssClass="topNavItem"/>
      <StaticSelectedStyle CssClass="topNavSelected"/>
      <StaticHoverStyle CssClass="topNavHover" />
     
      </SharePoint:AspMenu>


    K.Mohamed Faizal, Solution Architect, Singapore
    http://faizal-comeacross.blogspot.com/

  • Out of the box provide your One Level... if you need more sub meun you need to Edit your Master Page and Look for below properties  change your menu



    Thanks

    i modified the master page as follow :

    <SharePoint:AspMenu ID="GlobalNav" Runat="server" DataSourceID="SiteMapDataSource1"
    								Orientation="Horizontal" StaticDisplayLevels="1" MaximumDynamicDisplayLevels="5"
    								StaticSubMenuIndent="0" DynamicHorizontalOffset="0" DynamicVerticalOffset="-8"
    								StaticEnableDefaultPopOutImage="false" ItemWrap="false" SkipLinkText="<%$Resources:cms,masterpages_skiplinktext%>" CssClass="topNav">
    									<StaticMenuItemStyle CssClass="topNavItem" ItemSpacing="0"/>
    									<StaticSelectedStyle CssClass="topNavSelected" ItemSpacing="0"/>
    									<StaticHoverStyle CssClass="topNavHover"/>
    									<DynamicMenuStyle CssClass="topNavFlyOuts" />
    									<DynamicMenuItemStyle CssClass="topNavFlyOutsItem" />
    									<DynamicHoverStyle CssClass="topNavFlyOutsHover"/>
    								</SharePoint:AspMenu>
    

    but still i can't make new sub heading for my top link bar in 'modify navigation' page.
    also this option 'Show Subsites' has been checked.

    this is my Signature
    • Edited by Mike Walsh FIN Sunday, January 23, 2011 7:53 AM Do not use full quote
    Sunday, August 23, 2009 9:23 PM
  • Using Modify Navigation you can view only 1 Level, Select Sub Sites and Show Pages options and Than Create Sub Site OR Pages, I sure that will appear in the menu... give a try and let me know
    K.Mohamed Faizal, Solution Architect, Singapore
    http://faizal-comeacross.blogspot.com/
  • Using Modify Navigation you can view only 1 Level,
    Thanks K.Mohamed
    i don't have subSite. i didn't uderstand what's Pages options and what i must to do.
    • Edited by Mike Walsh FIN Sunday, January 23, 2011 7:52 AM Do not use full quote
    Monday, August 24, 2009 9:25 PM
  • I mean that subsites and pages do not automatically appear you need to configure so that the Sub Site are Page display under navigations

    1.     Do one of the following:

    §  On the Site Actions menu, click Site Settings.

    §  On the Site Actions menu, point to Site Settings, and then click Modify All Site Settings.

    2.     In the Look and Feel column, click Navigation.

     NOTE   The Navigation command appears under Look and Feel only if the publishing features are enabled for your site and you have the Full Control or Design permission level.

    3.     In the Subsites and Pages section, do one of the following:

    §  To show links to subsites in the top link bar and Quick Launch, select the Show subsites check box.

    §  To show links to pages in the top link bar and Quick Launch, select the Show pages check box.

    §  To hide links to subsites in the top link bar and Quick Launch, clear the Show subsites check box.

    §  To hide links to pages in the top link bar and Quick Launch, clear the Show pages


    K.Mohamed Faizal, Solution Architect, Singapore
    http://faizal-comeacross.blogspot.com/
    Monday, August 24, 2009 9:58 PM
  • I mean that subsites and pages do not automatically appear you need to configure so that the Sub Site are Page display under navigations


    Thanks
    but i know all of this, i want to display more levels in sub Menus via Heading links.
    can anybody help me ?


    this is my Signature
    • Edited by Mike Walsh FIN Sunday, January 23, 2011 7:51 AM Do not use full quote
    Tuesday, August 25, 2009 6:28 PM
  • even I am looking for this kind of navigation

    Heading -> Sub-Heading -> Links

    By default you can create only one heading using out of box functionality in sharepoint navigation.But our requirement is creating sub headings inside headings and this functionality is not provided out of box.

    The solution given by Mohamed to change StaticDisplayLevels, MaximumDynamicDisplayLevels works only in case of sites and pages as we can create any 3,4 level hierarchy in sites subsites.But with heading and link we can not go beyond 2 levels.

    I used SP object model to create sub headings.the code is as follows.

    SPSite MySite = new SPSite("http://moss:2525/");
            SPWeb oWeb = MySite.OpenWeb();
            SPNavigationNode oNewNode = new SPNavigationNode("Heading", "");
            oWeb.Navigation.QuickLaunch.AddAsLast(oNewNode);
            oNewNode.Properties.Add("NodeType", "Heading");
            oNewNode.Update();
    
    
            SPNavigationNode oChild1 = new SPNavigationNode("SubHead1", "/");
            oNewNode.Children.AddAsFirst(oChild1);
            oChild1.Properties.Add("NodeType", "Heading");
            oChild1.Update();
    
            SPNavigationNode oChild2 = new SPNavigationNode("SubHead2", "/");
    oNewNode.Children.Add(oChild2, oChild1); oChild2.Properties.Add("NodeType", "Heading"); oChild2.Update(); SPNavigationNode oChild3 = new SPNavigationNode("SubHead3", "/");
    oNewNode.Children.Add(oChild3, oChild2); oChild3.Properties.Add("NodeType", "Heading"); oChild3.Update();

    This works fine and creates navigation as follows:

    Heading

    SubHead1

    SubHead1

    SubHead1

    But my problem is that I am unable to add links to these subheadings.Can anyone help in this regard?

    Wednesday, April 28, 2010 5:27 AM
  • Hammed/Smriti

    step 1:you can create more sub levels using the site map available in the TEMPLATE\LAYOUTS folder.

    search for sitemap and make a copy of it and modify the code to add your sub menus and multiple levels of menus

    step 2: add safe control entry in web.config file of ur web app

    step 3 : give reference to your master page too.

    """i want to display more levels in sub Menus via Heading links""   hammed/smriti you can add links to sub headings for sure just try to have work around with site map CAML plzz

    hope this helps you

     

    Wednesday, April 28, 2010 12:03 PM
  • Hammed/Smriti,

    Where did you end up on this..Am also looking for the same. Please suggest.

    Thanks

    Kiran

    Thursday, July 15, 2010 7:48 PM
  • Thansk a lot K. Mohamed. Your information was very helpful! I am Sharepoint Rookie and I really appreciate this detailed explanation.

    Regards.

    Julio Rivera

    Thursday, September 23, 2010 4:52 PM
  • Here is my code in a custom Master.page I used SharePoint Designer to set the DataSourceID=SiteMapDataSource1 – in the GUI click the TopMenuNav bar click the top-right > arrow and then “New Data Source” use the default name.

    Code should look like this. I also changed the SPSiteMapProvider under
    SiteMapProvider in both ID= under AspMenu and SiteMapProvider under
    aspSiteMapDataSource

    <SharePoint:AspMenu
    	 ID="SPSiteMapProvider"
    	 Runat="server"
    	 EnableViewState="false"
    	 DataSourceID="SiteMapDataSource1"
    	 UseSimpleRendering="true"
    	 UseSeparateCss="false"
    	 Orientation="Horizontal"
    	 StaticDisplayLevels="2"
    	 MaximumDynamicDisplayLevels="4"
    	 SkipLinkText=""
    	 CssClass="s4-tn"/>
    	<asp:SiteMapDataSource runat="server" ID="SiteMapDataSource1" />
    	<SharePoint:DelegateControl runat="server" ControlId="TopNavigationDataSource" Id="topNavigationDelegate">
    		<Template_Controls>
    			<asp:SiteMapDataSource
    			 ShowStartingNode="True"
    			 SiteMapProvider="SPSiteMapProvider"
    			 id="topSiteMap"
    			 runat="server"
    			 StartingNodeUrl="sid:1002"/>
    		</Template_Controls>
    	</SharePoint:DelegateControl>
    find the entire post at http://jbenisek.wordpress.com

     

    Moderator Note: Do NOT propose your own posts as answer. The "Propose as Answer" function is there so that people can propose the good answers of other people. It is not there for self-proposal.


    Vote for Freedom - Vote to Protect our Country

    • Proposed as answer by Jbenisek Saturday, January 22, 2011 9:57 PM
    • Unproposed as answer by Mike Walsh FIN Sunday, January 23, 2011 7:49 AM
    • Edited by Mike Walsh FIN Sunday, January 23, 2011 7:51 AM Modertaor Note added
    Saturday, January 22, 2011 9:56 PM
  • Hi,

    You cannot add headings under another heading. Headings always appea on the same level.

    If you would like to have levels of navigation, for example

    Test

         Test-1

              Test-11

              Test-12

         Test-2

              Test-21

              Test-22

    This is what you have to do.

    • Create a sub-site Test (from Site Actions > Create Site)
    • Now navigate to the sub-site Test
    • Create another sub-site Test-1 (from Site Actions > Create Site)
    • Now navigate to the sub-site Test-1
    • Create another sub-site Test-11 (from Site Actions > Create Site)
    • Now navigate to Test. Click Site Actions > Site Settings > Navigation and set tje options as in the below screenshot.

    You have the desired result.. Hope it helped !!


    Best Regards,
    Gagandeep Singh
    http://mscrmnovice.blogspot.com

    Wednesday, April 04, 2012 6:53 AM
  • I have been fighting with this for almost a month now and can't get anywhere. By following the above direction, i get nothing but the following:

    On the right hand side, Test is the root, test-1 is the subsite, and test-1-1 is the subsite of test-1

    I have ALL of the sites configured with Publishing enabled, and ALL showing

    Once in a while, seemingly at random, the Test menu will show as a dropdown, but ONLY a single level, IE, Test ==> test-1

    I have NEVER gotten the Top Link drop down to ever list more than a single level.  The most aggravating part is that it was dead simple in MOSS, but of course since I sold 2010 to a client, it will not work.  Does anyone have an actual solution that does not involve completely writing my own custom navigation provider?

    Thursday, May 03, 2012 5:34 PM
  • Disregard - Apparently my problem was related to having BOTH StaticDisplayLevels AND DynamicDisplayLevels within the master page = 4 when ONLY the Dynamic should be 4; for me, having the static = 2 like the masterpage code a few posts above makes the drop down from the Top Link work perfectly - and right in the nic of time to present to the client tomorrow!

    Thursday, May 03, 2012 8:13 PM
  • Please let me know if somebody could achieve multiple level of submenus in Top Navigation in Publishing sites.

    My requirement is almost same - I've a publishing site with several Header links in Top Navigation. Under one header link, I want 2-3 levels of submenus i.e.

    Header link

    sublink1

    sublink2

    sublink3

                  sublink31

                  sublink32

                  sublink33

    sublink4

    Please let me know how can I achieve it without writing any custom code.

    Many Thanks!

    Friday, May 11, 2012 4:08 PM
  • Hi Ashish,

    There is a very simple solution to do this. basically use custom site map provider which reads from xml and then create a delegate feature. This should solve your problem.

    If you are still not able to figure out let me know. I will send you some code sample. I have done this in multiple projects


    Akhilesh Gandhi SharePoint Architect @SanDisk 201-275-5755

    Tuesday, August 28, 2012 11:36 PM
  • Hi Akhilesh,

    Can u please send me the code on my id tiwari.anurag@gmail.com

    Thanks in Advance.

    Anurag

    Monday, September 24, 2012 1:51 PM
  • Hi Akhilesh

    Can u Pls send me the solution for the above to munisha23@gmail.com..

    Thanks in advance for ur help....


    Munisha

    Wednesday, October 03, 2012 10:48 AM
  • Hi Akhilesh,

    Would you please send your solution to fereshteh.shafaghi@gmail.com.

    I have done this using database but it is kind of dirty development. I am eager to know how did you do this.

    Cheers,

    Friday, October 12, 2012 6:00 AM
  • Sorry for late reply. I will dig into my code base and upload code in a day.

    There are three steps required in this solution

    1. Create a sitemap file with level of navigation you want. copy it to 

    /_layouts/1033/MyNavProvider/mySiteMap.sitemap

    I will copy and paste format later today

    2. In web.config add 

    <add name="MyNavProvider" siteMapFile="/_layouts/1033/MyNavProvider/mySiteMap.sitemap"  type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

    n level navigation does not work in system page. Fix for issue issue is create a delegate wsp. write to me if you want me to mail you delegate code. I will try to upload code for delegate in a day.



    Akhilesh Gandhi SharePoint Architect @SanDisk 201-275-5755

    Friday, October 12, 2012 5:43 PM
  • Friday, October 12, 2012 5:48 PM
  • Hi

    I found the below blog post, which do this job for you:

    http://meherkanthch.blogspot.com/2008/11/how-to-add-to-sub-sub-menu-in.html

    Tuesday, March 26, 2013 7:38 PM