1、尝试恢复到OOB v4.master,看看问题是否消失。如果它按预期工作,这意味着您的母版页有问题。
SP 中最可笑的错误之一是,如果您没有在功能区控件之前SiteAction
声明控件,则某些 javascript 代码将失败。
在我的一个自定义母版页中,我必须在功能区控件之前创建第二个站点操作控件。我已将其放入一个不可见的 DIV 中以完全对用户隐藏它。
它以这样的方式结束:
<SharePoint:SPRibbon ID="SPRibbon1" runat="server" PlaceholderElementId="RibbonContainer"
CssFile="">
<SharePoint:SPRibbonPeripheralContent ID="SPRibbonPeripheralContent1" runat="server"
Location="TabRowLeft" CssClass="ms-siteactionscontainer s4-notdlg">
<!-- Here is the hidden site actions control -->
<div style="display: none">
<SharePoint:SiteActions runat="server" AccessKey="<%$Resources:wss,tb_SiteActions_AK%>"
ID="SiteActionsMenuMain" PrefixHtml="" SuffixHtml="" MenuNotVisibleHtml="&nbsp;">
<CustomTemplate>
</CustomTemplate>
</SharePoint:SiteActions>
</div>
<asp:ContentPlaceHolder ID="PlaceHolderGlobalNavigation" runat="server" Visible="false">
<SharePoint:PopoutMenu
runat="server"
>
.... Removed for readability ....
</SharePoint:PopoutMenu>
<div class="s4-die">
<asp:ContentPlaceHolder ID="PlaceHolderGlobalNavigationSiteMap" runat="server" Visible="false">
</asp:ContentPlaceHolder>
</div>
</asp:ContentPlaceHolder>
</SharePoint:SPRibbonPeripheralContent>
<SharePoint:SPRibbonPeripheralContent runat="server" Location="TabRowRight" ID="RibbonTabRowRight"
CssClass="s4-trc-container s4-notdlg">
.... Removed for readability ....
</SharePoint:SPRibbonPeripheralContent>
</SharePoint:SPRibbon>
供您参考,此行为是由于站点操作的内部控制之一(如果我是对的,则为 PublishingConsole)。这个内部控件将产生一些 javascript 全局变量声明(语言和另一个)。功能区控件需要此全局变量才能按预期工作。