代码之家  ›  专栏  ›  技术社区  ›  netadictos

在Sharepoint中,我需要为选择新页面布局的屏幕包含一个预览图像

  •  2
  • netadictos  · 技术社区  · 15 年前

    当您在列表框中选择其他元素时,左侧会出现一个预览图像。 我认为这是由布局的xml中的节点PublishingPreviewImage控制的。我已经确认了那个地方有图像。

    它不起作用。

    我使用的代码是:

    <File Path="TituloTextoCtrl.aspx" Url="TituloTextoCtrl.aspx" Type="GhostableInLibrary" IgnoreIfAlreadyExists ="TRUE">
          <Property Name="PublishingPreviewImage" Value="~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/titulotextoctrl.png, ~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/titulotextoctrl.png" />
                <Property Name="MasterPageDescription" Value="Plantilla Titulo+Texto+Control" />
                <Property Name="ContentType" Value="Titulo+Texto+Control" />
                <Property Name="PublishingAssociatedContentType" Value=";#Vialibre_ContentTypeGeneral;#0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF39005215cca003b74e479baa123eb1dc5702;#" />
            </File>
    
    3 回复  |  直到 15 年前
        1
  •  2
  •   Rich Bennema    15 年前

    您还需要XML来提供图像:

    <Module Name="MyPreviewImages" Url="_catalogs/masterpage" IncludeFolders="??-??" Path="" RootWebOnly="TRUE">
        <File Url="titulotextoctrl.png" Name="Preview Images/titulotextoctrl.png" Type="GhostableInLibrary">
        </File>
    </Module>
    
        2
  •  1
  •   Hojo    15 年前

    选择编辑布局页的属性,您可以在那里看到该布局页的属性。有一列叫做preview image,给出你已经上传到文档库的图片的url。点击Ok,现在你已经得到了布局页面的预览图像。

        3
  •  0
  •   netadictos    15 年前

    Thx给Rich Bennema和Hojo回答,有对的,但同时,我的问题是这个布局被部署了,当我再次部署更改PublishingPreviewImage时,布局没有更新。因此,我的问题是控制事件的问题,以便每次部署布局时都重新创建,以防发生更改。

    这我知道,因为它已经为新的布局工作。

    所以对于那些尝试这个的人来说。使用我提供的一个Rich Bennema的代码上传图片。

    推荐文章