我有以下代码将顶部全局导航中的子站点显示为多级下拉菜单:
<div id="s4-topheader2" class="s4-pr s4-notdlg">
<a name="startNavigation"></a>
<div id="s4-searcharea" class="s4-search s4-rp">
<asp:ContentPlaceHolder id="PlaceHolderSearchArea" runat="server">
<SharePoint:DelegateControl runat="server" ControlId="SmallSearchInputBox" Version="4"/>
</asp:ContentPlaceHolder>
<span class="s4-help">
<span style="height: 17px; width: 17px; ; display: inline-block; overflow: hidden;" class="s4-clust">
<a href="#" style="height: 17px; width: 17px; display: inline-block;" onclick="TopHelpButtonClick('HelpHome');return false" accesskey="<%$Resources:wss,multipages_helplink_accesskey%>" id="TopHelpLink" title="<%$Resources:wss,multipages_helplinkalt_text%>" runat="server">
<img src="/_layouts/images/fgimg.png" alt="<%$Resources:wss,multipages_helplinkalt_text%>" style="left: -0px !important; top: -309px !important; ;" align="absmiddle" border="0" runat="server" /></a></span>
</span>
</div>
<div class="s4-rp s4-app"></div>
<div class="s4-lp s4-toplinks">
<asp:ContentPlaceHolder id="PlaceHolderTopNavBar" runat="server">
<h2 class="ms-hidden">
<SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,topnav_pagetitle%>" EncodeMethod="HtmlEncode"/>
</h2>
<asp:ContentPlaceHolder id="PlaceHolderHorizontalNav" runat="server">
<SharePoint:AspMenu
ID="TopNavigationMenuV4"
Runat="server"
EnableViewState="false"
DataSourceID="topSiteMap"
AccessKey="<%$Resources:wss,navigation_accesskey%>"
UseSimpleRendering="true"
UseSeparateCss="false"
Orientation="Horizontal"
StaticDisplayLevels="2"
MaximumDynamicDisplayLevels="11"
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>
</asp:ContentPlaceHolder>
</asp:ContentPlaceHolder>
</div>
</div>
它工作正常,除了子站点不是按字母顺序排列的。
我注意到一些有趣的事情;不按顺序排列的站点是我移动的站点。这些出现在最后。我尝试将所有子站点移动到一个新创建的临时站点并按字母顺序将它们移回,但没有奏效。就好像保留了最初创建站点的订单一样。
我使用的是 SharePoint 2010 标准版。