1

我正在尝试在 Sharepoint Foundation 2010 中设置母版页的样式。我正在使用夜间大师和样式。

设计没有丝带,我只需要把它关掉。简直是老掉牙了。当我将功能区 div 设置为 display: none 时,整个顶部横幅都会消失。

我不是共享点开发人员,总的来说我迷路了。有没有一种简单的方法来隐藏/摆脱丝带?对所需的权限没有什么特别的要求——只需要总是消失。

4

5 回答 5

3

您要查看的 CSS 类是;

<style type="text/css">
    div#s4-ribbonrow.s4-pr.s4-ribbonrowhidetitle { height:43px !important }
    /*.ms-cui-ribbon { display:none; }*/
    .s4-ribbonrowhidetitle s4-notdlg noindex { height: 43px !important; }
    .s4-title h1 a,.s4-title h2 a,.s4-title h2 { font-size: small; }
    .ms-pagetitleareaframe table { background: none; }
    #s4-leftpanel-content { display:none !important; }
    #s4-titlerowhidetitle { display:none !important; }
    .s4-ca { margin-left:0px !important; margin-right:0px !important; }
</style>
于 2012-03-16T00:42:54.680 回答
2

您应该能够使用本文中的信息来帮助您入门。

http://www.endusersharepoint.com/2010/11/09/hiding-the-sharepoint-2010-ribbon-from-anonymous-users/

于 2010-11-17T14:38:02.010 回答
1

如果有人一直在努力解决这个问题。隐藏功能区可能会导致一些进一步的问题(http://social.msdn.microsoft.com/Forums/en-US/9422aa0f-5010-4691-a0ab-25e7aca6b478/issue-with-div-s4workspace-and-scroll-bar )

特别是如果您将包含自己的标题并隐藏功能区。

一个快速的解决方法是使用 css。#s4-workspace 仍将获得正确的高度,滚动条不会成为问题,并且功能区将被隐藏。:

body #s4-ribbonrow {
    height: 0px !important;
    min-height: 0px !important;
}

于 2013-12-12T18:33:59.733 回答
0

万一其他人为此苦苦挣扎,这里有完整的说明,可以在不破坏滚动条或丢失标题栏区域或任何其他奇怪情况的情况下执行此操作:

隐藏不会丢失标题栏区域的 Sharepoint 2010 功能区

于 2014-01-13T18:31:32.303 回答
0

正如 knight0323 答案的链接页面中所述,可以通过编辑v4.master和包装功能区 div来隐藏功能区<SharePoint:SPSecurityTrimmedControl/>

<SharePoint:SPSecurityTrimmedControl PermissionsString="ManagePermissions" runat="server">
    <div id="s4-ribbonrow" class="s4-pr s4-ribbonrowhidetitle">
        <!-- Ribbon code appears here... -->
    </div>
</SharePoint:SPSecurityTrimmedControl>

不幸的是,在我的系统上,这有一个副作用,即页面的滚动条开始出现异常。这似乎是功能区和s4-workspacediv 之间存在依赖关系的结果。因此,为了解决这个问题,我<SharePoint:SPSecurityTrimmedControl/>从功能区 div 移入以包装<div id="s4-ribboncont">并在顶部附近添加以下标记v4.master

<style type="text/css">
        #s4-ribbonrow { display: none; }
</style>
<SharePoint:SPSecurityTrimmedControl PermissionsString="ManagePermissions" runat="server">
    <style type="text/css">
        #s4-ribbonrow { display: block; }
    </style>
</SharePoint:SPSecurityTrimmedControl>

这样做的效果是功能区默认隐藏,但足够的标记保留在 DOM 中,因此页面继续正常运行。对于管理员,功能区正常显示。

于 2013-08-06T23:51:54.530 回答