的SharePoint Foundation 2010:隐藏色带完全

问题描述:

我试图风格的SharePoint Foundation 2010年我的“主页M使用nightandday主和风格的SharePoint Foundation 2010:隐藏色带完全

设计有没有丝带,我只是需要将其关闭。 。当我设置丝带div显示:无,整个顶部的横幅消失。

我不是一个共享点的开发,一般都失去了。是否有一种简单的方法来隐藏/获取摆脱丝带?没有什么花哨的权限需要 - 只需要永远消失

你应该能够使用这个信息在这rticle让你开始。你想

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

+0

这带来了一个好点 - 你不想隐藏所有用户的色带。如果你这样做,你已经有效地创建了一个只读(或者最好的,一个添加)网站。 – 2010-11-18 13:41:08

+0

谢谢,希望这会起作用。我没有办法测试它,但是当我将它添加到母版页时,Sharepoint不会投诉! – dex3703 2010-11-22 22:31:39

CSS类看有;

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

不幸的是我的系统上这个有副作用:

<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> 

正如knight0323的答案的链接的页面文件,色带可以通过编辑v4.master和包装与<SharePoint:SPSecurityTrimmedControl/>色带DIV隐藏页面的滚动条开始行为异常。这似乎是色带和s4-workspace div之间的依赖关系的结果。因此,要解决这个我从色带DIV移动<SharePoint:SPSecurityTrimmedControl/>包裹<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中,所以页面继续正常工作。对于管理员,功能区显示正常。

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

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

一个快速的解决方法是使用CSS。 #S4工作空间仍然会收到正确的高度&滚动条将不会是一个问题,也是带将被隐藏:

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

如果别人与此挣扎,这里有全说明这样做不会破坏滚动条或失去标题栏区域,或任何其他古怪:

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