none
Navigation Settings not saving RRS feed

  • Question

  • I have created a custom site template with a custom masterpage in SharePoint 2010. In the site template I am using the following feature to set various navigation settings when a site is created using the template.        

        <Feature ID="541F5F57-C847-4e16-B59A-B31E90E6F9EA">
              <Properties xmlns="http://schemas.microsoft.com/sharepoint/">
                <Property Key="InheritGlobalNavigation" Value="false"/>
                <Property Key="InheritCurrentNavigation" Value="false" />
                <Property Key="ShowSiblings" Value="true" />
                <Property Key="IncludeSubSites" Value="true" />
                <Property Key="IncludePages" Value="false" />
                <Property Key="OrderingMethod" Value="Manual"/>
                <Property Key="AutomaticSortingMathod" Value="CreatedDate"/>
              </Properties>
            </Feature>
    

    This appears to work fine - NOTE: the ordering method is set to manual.

    However after creating some sub-sites when you use the SharePoint navigation page (_layouts/AreaNavigationSettings.aspx) to try and change the order of the subsites then press ok the new order settings have not been saved to the database. The same also happens if you add or hide a link for both global and current navigation items.

    I'm assuming that an exception of some sort is being raised whilst the save function is being executed but nothing is reported to the SharePoint log files.

    Has anyone come across this too/comments/offers/suggestions?

    Thanks,

     

    Adrian Williams
    Foreshore Consulting Ltd
    http://www.foreshoreconsulting.co.uk

     

    Wednesday, March 16, 2011 9:53 AM

Answers

  • OK so I managed to solve my problem.

    Here's what I found incase it helps someone else! In the default visual studio sitetemplate project template it creates the following in the onet.xml file

     

      <Module Name="Default" Url="" Path="" >
       <File Path="Default.aspx" Url="Default.aspx" />
      </Module>
    

    You may choose to add the following elements (NavBarHome and NavBarPage) to each file definition (There is some information on these in MSDN)

      <Module Name="Default" Url="" Path="" >
       <File Path="Default.aspx" Url="Default.aspx" NavBarHome="True" >
        <NavBarPage Name="Home" ID="1002" />
       </File>
      </Module>
    

    But the solution to the Global Navigation not saving problem was that the <NavBar> element by default is empty. I changed the empty NavBars element in onet.xml to

     <NavBars>
      <NavBar Name="$Resources:core,category_Top;" Separator="&amp;nbsp;&amp;nbsp;&amp;nbsp;" Body="&lt;a ID='onettopnavbar#LABEL_ID#' href='#URL#' accesskey='J'&gt;#LABEL#&lt;/a&gt;" ID="1002" />
     </NavBars>
    
    

     and hey presto the global navigation could be edited and saved once more.

    Wierd! and I'm not sure if this is a bug or a "feature" but either way it's working for me now!! :-D

    Adrian

    Saturday, March 26, 2011 10:24 AM

All replies

  • OK so I managed to solve my problem.

    Here's what I found incase it helps someone else! In the default visual studio sitetemplate project template it creates the following in the onet.xml file

     

      <Module Name="Default" Url="" Path="" >
       <File Path="Default.aspx" Url="Default.aspx" />
      </Module>
    

    You may choose to add the following elements (NavBarHome and NavBarPage) to each file definition (There is some information on these in MSDN)

      <Module Name="Default" Url="" Path="" >
       <File Path="Default.aspx" Url="Default.aspx" NavBarHome="True" >
        <NavBarPage Name="Home" ID="1002" />
       </File>
      </Module>
    

    But the solution to the Global Navigation not saving problem was that the <NavBar> element by default is empty. I changed the empty NavBars element in onet.xml to

     <NavBars>
      <NavBar Name="$Resources:core,category_Top;" Separator="&amp;nbsp;&amp;nbsp;&amp;nbsp;" Body="&lt;a ID='onettopnavbar#LABEL_ID#' href='#URL#' accesskey='J'&gt;#LABEL#&lt;/a&gt;" ID="1002" />
     </NavBars>
    
    

     and hey presto the global navigation could be edited and saved once more.

    Wierd! and I'm not sure if this is a bug or a "feature" but either way it's working for me now!! :-D

    Adrian

    Saturday, March 26, 2011 10:24 AM
  • Adrian,

     

    I have the same problem in Sharepoint. I tried searching for the file ONET.XML and I found 25 occurrences. Can you guide me to the right file to change?

     

    Thanks,

    HenkK

    Friday, July 1, 2011 9:08 AM
  • Adrian this is belated but your fix solved my equivalent issue. I can finally update the global nav for the sites created from my site definition.

     

    Cheers,

     

    Mike


    Mike
    Wednesday, October 12, 2011 3:29 PM
  • I'm having this issue as well, and only when my custom master page is applied to a site. I've tried cleaning up the <NavBars> element in a couple of my ONET.xml files, then resetting iis and testing. Still no luck. For which template should I checking the ONET.xml file?  I've tried 'STS' and 'Publishing', among others.

    Friday, January 20, 2012 12:37 AM
  • That does seam bizzare if it works with the standard masterpage but when you change it to your custom one the navigation settings are not saving. I took the above navbar XML from the Template/siteTemplates/sts/xml/onet.xml file.

    Just to make sure this is the same problem - I had a site with the Publishing Features enabled and the page that was causing the problem was "_layouts/AreaNavigationSettings.aspx". If this isn't the same as your problem then it probably is sometthhing else.

    Final thought - if it's working with the standard masterpage but not with your custom masterpage - it might be worth checking that your custom masterpage has the correct code for the ASPMenu control (try taking the code from another masterpage). Code below is from one of the standard templates

    <SharePoint:AspMenu
    	  ID="TopNavigationMenuV4"
    	  Runat="server"
    	  EnableViewState="false"
    	  DataSourceID="topSiteMap"
    	  AccessKey="<%$Resources:wss,navigation_accesskey%>"
    	  UseSimpleRendering="true"
    	  UseSeparateCss="false"
    	  Orientation="Horizontal"
    	  StaticDisplayLevels="2"
    	  MaximumDynamicDisplayLevels="1"
    	  SkipLinkText=""
    	  CssClass="s4-tn"/>
    	<SharePoint:DelegateControl runat="server" ControlId="TopNavigationDataSource" Id="topNavigationDelegate">
    		<Template_Controls>
    			<asp:SiteMapDataSource
    			  ShowStartingNode="False"
    			  SiteMapProvider="SPNavigationProvider"
    			  id="topSiteMap"
    			  runat="server"
    			  StartingNodeUrl="sid:1002"/>
    		</Template_Controls>
    	</SharePoint:DelegateControl>
    

     

     

     

    Friday, January 20, 2012 9:03 AM
  • Adrian,

    Indeed it happens only when i have my custom masterpage applied as the system masterpage. When I revert the system masterpage back to v4.master I am able to edit the Navigation settings. I also have the publishing features enabled and "_layouts/AreaNavigationSettings.aspx" is the page I'm using to modify the navigation.

    I checked my custom masterpage and it has the same exact block of code you posted. Can you think of anything else?
    It would be great if ULS logs could tell me anything.

    Friday, January 20, 2012 4:46 PM