【问题标题】:Sharepoint 2013 - Hide left Navigation, but not in People and GroupsSharepoint 2013 - 隐藏左侧导航,但不在人员和组中
【发布时间】:2013-08-15 02:47:37
【问题描述】:

我试图隐藏左侧导航栏,它可以正常工作。现在唯一的问题是当我进入:站点设置>用户权限>人员和组

它隐藏了我在左侧创建的群组。是否有可能在所有站点中隐藏左侧导航栏并单独保留“人员和组”?

我制作了自己的 css 文件并用它来隐藏导航栏:

MyOwnCss.css:

#sideNavBox { DISPLAY: none }
#contentBox { margin-left: 0px }

最好的问候

安德鲁

【问题讨论】:

    标签: css sharepoint sharepoint-designer sharepoint-2013


    【解决方案1】:

    解决方案:

    试试下面的css(而不是你的):

    .ms-core-sideNavBox-removeLeftMargin { display: none } /* hide only quick links */
    #contentBox { margin-left: 0px } /* make content take full page width */
    

    说明:

    id为sideNavBox的Div是左侧导航框的主容器。但它不是保存快速链接的实际容器。

    实际上快速链接包含在另一个类为ms-core-sideNavBox-removeLeftMargin 的div 中,它是id 为sideNavBox 的div 的子div。

    现在人员和组左侧面板项不包含在此 div 中,类为 ms-core-sideNavBox-removeLeftMargin,而是包含在其上方的 div 中,类为 ms-ql-additionaltopsection(如上图所示)。

    所以我们上面的解决方案隐藏了这个包含子 div 的实际快速链接:

    .ms-core-sideNavBox-removeLeftMargin { display: none } /* 只隐藏快速链接 */

    而不是父容器

    #sideNavBox { display: none } /* 隐藏左侧导航框 */

    你可以找到我关于此事的详细博客here

    【讨论】:

    • 非常感谢您的努力!真正伟大的问题解决方案,Purnil!
    • .ms-core-sideNavBox-removeLeftMargin { display: none } 当您在顶部使用全局导航栏时,也应该使用隐藏左侧导航框。设置 #sideNavBox { DISPLAY: none } 也会隐藏顶部导航栏..
    【解决方案2】:

    如果您希望仅在特殊情况下删除 sidenavbox,那么您应该执行以下操作:
    1. 在 SharePoint 设计器中编辑 相关 母版页(在下面的示例中,我编辑了系统母版页。
    下面的示例检查表单页面并仅在此处删除 sidenavbox。
    2. 添加以下脚本(jQuery):
    代码:

       <script>
          $(document).ready(function () {
    
            if(window.location.href.indexOf("newifs.aspx") > -1) {
                 $('#sideNavBox').css('display', 'none');
                 $('#contentBox').css('margin-right', '0px');
               }
    
            if(window.location.href.indexOf("editifs.aspx") > -1) {
               $('#sideNavBox').css('display', 'none');
               $('#contentBox').css('margin-right', '0px');
             }
    
           if(window.location.href.indexOf("displayifs.aspx") > -1) {
              $('#sideNavBox').css('display', 'none');
              $('#contentBox').css('margin-right', '0px');
          }
    
      })
    </script>
    


    3. 保存并签入母版页。
    现在,您无需编辑包含表单的每个页面来添加内容 webpart 等。这将适用于脚本中指定的所有页面。

    【讨论】:

      猜你喜欢
      • 2015-09-13
      • 2016-12-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-25
      • 1970-01-01
      • 1970-01-01
      • 2013-11-18
      相关资源
      最近更新 更多