简体   繁体   English

Sharepoint母版页实施

[英]Sharepoint Master Page Implementation

我已经有一位同事创建的母版页,如何在SharePoint中实现此母版页?

There are several ways you can use to change the master page of a SharePoint site. 您可以使用多种方法来更改SharePoint网站的母版页。 Here are some http://sharepointmagazine.net/articles/deploying-the-master-page , http://office.microsoft.com/en-us/sharepoint-designer-help/change-the-current-master-page-HA010167165.aspx . 这里有一些http://sharepointmagazine.net/articles/deploying-the-master-pagehttp://office.microsoft.com/en-us/sharepoint-designer-help/change-the-current-master-page -HA010167165.aspx I hope it helps. 希望对您有所帮助。

If you want to create and deploy a new master page using Visual Studio 2010, see following steps. 如果要使用Visual Studio 2010创建和部署新的母版页,请参见以下步骤。

1.Right click SharePoint Project in Visual Studio select Add New Item. 1.右键单击Visual Studio中的SharePoint项目,然后选择“添加新项”。

2.Select Module Template and name it as MasterPageModule. 2.选择模块模板并将其命名为MasterPageModule。 Click Add. 单击添加。

3.Rename the Sample.txt to Sample.master 3.将Sample.txt重命名为Sample.master

4.Open the Elements.xml, delete existing text and replace with following code 4.打开Elements.xml,删除现有文本并替换为以下代码

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="MasterPageModule" List="116" Url="_catalogs/masterpage">
    <File Path="MasterPageModule\Sample.master" Url="MasterPageModule/Sample.master" Type="GhostableInLibrary" IgnoreIfAlreadyExists="false" />
  </Module>
</Elements>

5.Open the existing site with SharePoint Designer. 5.使用SharePoint Designer打开现有网站。

6.Go to Site Objects -> Master Pages and copy v4.master 6.转到站点对象->母版页并复制v4.master

7.Rename and select the new file. 7.重命名并选择新文件。

8.To edit the file select Customization -> Edit. 8.要编辑文件,请选择定制->编辑。

9.Select Yes for "Do you want to check it out?" 9.在“您要签出吗?”中选择“是”。 message. 信息。

10.Select all code from the copied master page and copy to the Sample.master file. 10.从复制的母版页中选择所有代码,然后复制到Sample.master文件。

11.Modify the code (You can also modify the file in SP Designer and then copy) 11.修改代码(您也可以在SP Designer中修改文件,然后复制)

12.Build and deploy the solution. 12.构建并部署解决方案。

13.Go to http:///_catalogs/masterpage/Forms/AllItems.aspx 13.转到http:///_catalogs/masterpage/Forms/AllItems.aspx

14.Open the MasterPageModule Folder. 14.打开MasterPageModule文件夹。

You'll see the deployed Sample.master page. 您将看到已部署的Sample.master页面。

Using SharePoint designer, connect to your site and copy the master page file into the Master Page library. 使用SharePoint Designer,连接到您的网站并将母版页文件复制到母版页库中。 Then right click on the master page file in SP Designer and select "Set as Default Master Page". 然后右键单击SP Designer中的母版页文件,然后选择“设置为默认母版页”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM