• SharePoint 2013 网站定义中添加页面布局


     今天在Visual Studio 2012中将页面布局打包到网站定义中。

    新建Module “MasterPageGallary”

    在Element中如下:

    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
      <Module Name="MasterPageGallary" List="116" Url="_catalogs/masterpage" Path="MasterPageGallary" RootWebOnly="TRUE">
        <File Path="EnterprisePortal.master" Url="EnterprisePortal.master" Type="GhostableInLibrary" IgnoreIfAlreadyExists="True" NavBarHome="False">
          <Property Name="Title" Value="企业门户母版页" />
          <Property Name="ContentTypeId" Value="0x010105" />
          <Property Name="UIVersion" Value="15" />
        </File>
        <File Path="EnterprisePortal_Welcome.aspx" Url="EnterprisePortal_Welcome.aspx" Type="GhostableInLibrary" IgnoreIfAlreadyExists="True" NavBarHome="False">
          <Property Name="Title" Value="企业门户欢迎页" />
          <Property Name="ContentType" Value="$Resources:cmscore,contenttype_pagelayout_name;" />
          <Property Name="PublishingAssociatedContentType" Value=";#$Resources:cmscore,contenttype_welcomepage_name;;#0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF390064DEA0F50FC8C147B0B6EA0636C4A7D4;#" />
        </File>
    </Module>
    </Elements>

    结果,部署后看似正常,可KenDie的微软,居然在页面布局这个页面中添加一段html代码,类似

    <html xmlns:mso="urn:schemas-microsoft-com:office:office"
    
    xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"><head>
    <META name="WebPartPageExpansion" content="full">
    <!--[if gte mso 9]><xml>
    <mso:CustomDocumentProperties>
    <mso:PublishingPreviewImage msdt:dt="string"></mso:PublishingPreviewImage>
    <mso:ContentType msdt:dt="string">Page Layout</mso:ContentType>
    <mso:MasterPageDescription msdt:dt="string"></mso:MasterPageDescription>
    <mso:PublishingAssociatedVariations msdt:dt="string">
    </mso:PublishingAssociatedVariations>
    <mso:PublishingHidden msdt:dt="string">0</mso:PublishingHidden>
    <mso:PublishingAssociatedContentType msdt:dt="string">
    ;#Agenda item;#0x010100C568DB52D...;#</mso:PublishingAssociatedContentType>
    </mso:CustomDocumentProperties>
    </xml><![endif]-->
    <title>Dummy Content Type</title></head>

    网上找了如下博客,终于解决这个问题。

    http://blog.mastykarz.nl/placeholderpagetitle-is-the-root-of-all-evil/

    原文的意思是,页面布局页面顶部,如果第一个Content的ContentPlaceholderID为PlaceHolderPageTitle的话,那么会自动在底部追加那段html。

    这个什么莫名其妙的Bug?不过能解决问题就好。

  • 相关阅读:
    Unity3D 5.3 新版AssetBundle使用方案及策略
    解构C#游戏框架uFrame兼谈游戏架构设计
    漫谈C#编程语言在游戏领域的应用
    TDD在Unity3D游戏项目开发中的实践
    趣说游戏AI开发:曼哈顿街角的A*算法
    “为什么DirectX里表示三维坐标要建一个4*4的矩阵?”
    趣说游戏AI开发:对状态机的褒扬和批判
    使用TypeScript拓展你自己的VS Code!
    MVP社区巡讲-云端基础架构:12月5日北京站 12月12日上海站
    【转】Spring Boot干货系列:(一)优雅的入门篇
  • 原文地址:https://www.cnblogs.com/Berkaroad/p/3326020.html
Copyright © 2020-2023  润新知