Sharepoint Foundation 2010:完全隐藏功能区

发布于 2024-10-02 15:57:58 字数 216 浏览 4 评论 0原文

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

该设计没有功能区,我只需将其关闭。只是普通的旧关闭。当我将功能区 div 设置为显示时:没有,整个顶部横幅消失了。

我不是共享点开发人员,并且一般都迷失了方向。有没有一种简单的方法可以隐藏/删除功能区?没有什么需要的权限 - 只是需要始终消失。 。

I am trying to style the master page in Sharepoint Foundation 2010. I"m using the nightandday master and styles.

The design has no ribbon and I just need to turn it off. Just plain old off. When I set the ribbon div to display: none, the entire top banner disappears.

I'm not a sharepoint dev and am lost in general. Is there an easy way to just hide/get rid of the ribbon? Nothing fancy about permissions required--just needs to be always gone.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

醉生梦死 2024-10-09 15:57:58

您想要查看的 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>

The CSS classes you want to look at are;

<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>
路弥 2024-10-09 15:57:58

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

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

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

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

In case someone has been struggling with this issue. Hiding the Ribbon may cause some further issues (http://social.msdn.microsoft.com/Forums/en-US/9422aa0f-5010-4691-a0ab-25e7aca6b478/issue-with-div-s4workspace-and-scroll-bar)

Especially if you will include your own header and hide the Ribbon.

A quick workaround is using css. #s4-workspace will still receive the correct height & scrollbar won't be an issue as well as the ribbon will be hidden.:

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

挽容 2024-10-09 15:57:58

正如 Knight0323 答案的链接页面中所述,可以通过编辑 v4.master 并用 包裹功能区 div 来隐藏功能区:

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

不幸的是在我的系统上,这会产生副作用,页面的滚动条开始出现异常行为。这似乎是功能区和 s4-workspace div 之间依赖关系的结果。因此,为了解决此问题,我将 从功能区 div 移入以包裹

并添加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 中保留足够的标记,以便页面继续正常运行。对于管理员来说,功能区正常显示。

As documented in the linked page of knight0323's answer, the ribbon can be hidden by editing v4.master and wrapping the ribbon div with <SharePoint:SPSecurityTrimmedControl/>:

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

Unfortunately on my system this has a side-effect where the page's scroll-bar starts misbehaving. This appears to be a result of a dependency between the ribbon and the s4-workspace div. So to resolve this I moved <SharePoint:SPSecurityTrimmedControl/> in from the ribbon div to wrap the <div id="s4-ribboncont"> and added the following markup near the top of 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>

The effect of this is that the ribbon is hidden by default but sufficient markup remains in the DOM so the page continues to behave correctly. For administrators, the ribbon is displayed normally.

过度放纵 2024-10-09 15:57:58

如果其他人遇到这个问题,这里有完整的说明,可以在不破坏滚动条或丢失标题栏区域或任何其他奇怪情况的情况下执行此操作:

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

In case anybody else is struggling with this, here are full instructions to do this without breaking the scroll bar or losing the title bar area, or any other oddities:

Hiding a Sharepoint 2010 ribbon that does not lose the titlebar area

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文