2012-08-16 23 views
1

我添加了自定義XML網站模板和網站創建。Sharepoint「全球導航」鏈接保存後消失

當我試圖修改頁面上默認的SharePoint導航: /_layouts/AreaNavigationSettings.aspx

爲「全球導航」更改無法應用。點擊「確定」按鈕後,「全局導航」文件夾變空。

有時在「當前導航」成爲分揀即使proprty設置「手動排序」(「當前導航」可以保存沒有任何問題!)

請告訴我gooing錯導航節點???

網絡功能:

<Feature ID="541F5F57-C847-4e16-B59A-B31E90E6F9EA"> 
     <!-- Per-Web Portal Navigation Properties--> 
     <Properties xmlns="http://schemas.microsoft.com/sharepoint/"> 
     <Property Key="InheritGlobalNavigation" Value="false"/> 
     <Property Key="IncludeSubSites" Value="true"/> 
     <Property Key="IncludePages" Value="false"/> 
     </Properties> 
    </Feature> 

在代碼中配置:

if (publishingWeb.Navigation != null) 
     { 
      publishingWeb.Navigation.OrderingMethod = OrderingMethod.Manual; 
      publishingWeb.Navigation.InheritGlobal = true; 
      publishingWeb.Navigation.GlobalIncludePages = false; 
      publishingWeb.Navigation.GlobalIncludeSubSites = false; 

      publishingWeb.Navigation.InheritCurrent = false; 
      publishingWeb.Navigation.CurrentIncludePages = false; 
      publishingWeb.Navigation.CurrentIncludeSubSites = false; 
     } 

     publishingWeb.PagesList.EnableModeration = false; 
     publishingWeb.Update(); 

沒有這個代碼我面臨同樣的問題!

P.s.只有我的網站不工作。

無法從Web檢索TopNavigationBar SPNavigationNodeCollection:/Pages/default.aspx。 SPNavigation商店可能已損壞。

回答

1

當您在onet.xml中定義新的網站定義時,請確保您沒有刪除默認的navbars!您可以在任何共享點默認的onet.xml中查看哪些navbars應該默認添加。在其他情況下,可能會出現意外問題!

<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" /> 
    <NavBar 
    Name="$Resources:core,category_Documents;" 
    Prefix="&lt;table border=0 cellpadding=4 cellspacing=0&gt;" 
    Body="&lt;tr&gt;&lt;td&gt;&lt;table border=0 cellpadding=0 cellspacing=0&gt;&lt;tr&gt;&lt;td&gt;&lt;img src='/_layouts/images/blank.gif' ID='100' alt='' border=0&gt;&amp;nbsp;&lt;/td&gt;&lt;td valign=top&gt;&lt;a ID=onetleftnavbar#LABEL_ID# href='#URL#'&gt;#LABEL#&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;" 
    Suffix="&lt;/table&gt;" 
    ID="1004" /> 
    ... 
</NavBars>