如何从SharePoint Chrome控件中删除标题和图标

时间:2013-10-30 14:53:23

标签: c# sharepoint

在SharePoint MVC应用程序中,我使用以下代码进行chrome Control。

<!-- Chrome control placeholder Options are declared inline.  -->
        <div
            id="chrome_ctrl_container"
            data-ms-control="SP.UI.Controls.Navigation"
            title="Title of the application"
            data-ms-options='{  

            "appIconUrl" : "Images/Logo.GIF",
            "appTitle" : "SharePoint MVC", 
            "appHelpPageUrl" : "Help.html",
            "settingsLinks" : [
                {
                    "linkUrl" : "Account.html",
                    "displayName" : "Account settings"
                },
                {
                    "linkUrl" : "Contact.html",
                    "displayName" : "Contact us"
                }
            ]
         }'>
        </div>

我想删除标题和网站图标,以便我可以在sharepoint栏后创建自定义标题。

Image for detail

2 个答案:

答案 0 :(得分:1)

根据您要删除的内容,您有一些选项:

  1. 调整data-ms-options属性中的选项。
  2. 您也可以删除data-ms-control。这将删除导航,您可以替换您想要的任何内容。
  3. 您可以在javascript中创建客户端chrome控件,而不是声明它。
  4. 参考:How to: Use the client chrome control in apps for SharePoint

答案 1 :(得分:1)

添加以下选项:

&#34; bottomHeaderVisible&#34;:false,

例如,您的代码为:

<!-- Chrome control placeholder Options are declared inline.  -->
        <div
            id="chrome_ctrl_container"
            data-ms-control="SP.UI.Controls.Navigation"
            title="Title of the application"
            data-ms-options='{  
            "bottomHeaderVisible": false,
            "appIconUrl" : "Images/Logo.GIF",
            "appTitle" : "SharePoint MVC", 
            "appHelpPageUrl" : "Help.html",
            "settingsLinks" : [
                {
                    "linkUrl" : "Account.html",
                    "displayName" : "Account settings"
                },
                {
                    "linkUrl" : "Contact.html",
                    "displayName" : "Contact us"
                }
            ]
         }'>
        </div>