Adding a WebPart to a SharePoint 2013 Master Page

本文详细介绍了在SharePoint2013中使用DesignManager-SnippetGallery自定义母版页WebPart的方法,包括如何正确地在注册标签中使用SPM标记,以及如何正确包裹WebPart的打开和关闭标签。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

On SharePoint 2013 you can not add the Web Parts to the master page the same way of 2010.
Please use the Design Manager -> Snippet Gallery.

In short:
You must wrap the Register tag with: <!--SPM: register tag -->
Like this:

<!--SPM:<%@Register Tagprefix="Publishing" Namespace="Microsoft.SharePoint.Publishing.WebControls" Assembly="Microsoft.SharePoint.Publishing, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>-->

You should wrap the opening tag of your Web Part with: <!--MS: tag -->
And the closing tag with: <!--ME: tag -->
The Web Part would look like this:

<!--MS:<asp:SiteMapDataSource ShowStartingNode="True" SiteMapProvider="SPNavigationProvider" ID="topSiteMap" runat="server" StartingNodeUrl="sid:1002">--><!--ME:</asp:SiteMapDataSource>-->

(Snippet Gallery will automatically create the tags in the right way and you can copy it to your master page.)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值