关闭

Adding a WebPart to a SharePoint 2013 Master Page

183人阅读 评论(0) 收藏 举报
分类:

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

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:9659次
    • 积分:190
    • 等级:
    • 排名:千里之外
    • 原创:6篇
    • 转载:19篇
    • 译文:1篇
    • 评论:2条
    文章分类