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

发布于 2024-08-26 08:44:21 字数 1013 浏览 1 评论 0原文

在 Sharepoint 2007 中,我创建了一个布局。如您所知,当用户创建页面时,他从列表框中选择布局。 当您在列表框中选择不同的元素时,左侧的预览图像会发生变化。 我认为这是由布局 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>

In Sharepoint 2007, I have created a layout. As you know when the user creates a page he chooses a layout from a listbox.
When you select a different element in the listbox, there is a preview image that changes on the left.
I thought this was controlled by the node PublishingPreviewImage in the xml of the layout. I have verified that the image exists in that place.

It is not working.

The code I use is:

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

不一样的天空 2024-09-02 08:44:21

您还需要 XML 来配置映像:

<Module Name="MyPreviewImages" Url="_catalogs/masterpage" IncludeFolders="??-??" Path="" RootWebOnly="TRUE">
    <File Url="titulotextoctrl.png" Name="Preview Images/titulotextoctrl.png" Type="GhostableInLibrary">
    </File>
</Module>

You also need XML to provision the image:

<Module Name="MyPreviewImages" Url="_catalogs/masterpage" IncludeFolders="??-??" Path="" RootWebOnly="TRUE">
    <File Url="titulotextoctrl.png" Name="Preview Images/titulotextoctrl.png" Type="GhostableInLibrary">
    </File>
</Module>
养猫人 2024-09-02 08:44:21

首先在网站集文档库或图片库中上传您的布局页面图像。然后转到站点操作-->站点设置-->图库-->母版页和页面布局-->。在页面布局中,您可以看到新的布局页面。
选择编辑布局页面的属性,您可以在其中看到该布局页面的属性。有一个名为预览图像的列,提供您已在文档库中上传的图像的 URL。单击“确定”,现在您已经获得了布局页面的预览图像。

first of all upload yor layout page image in site collection document library or picture libary. Then Go to site actions--> site settings-->Galleries-->master pages and pagelayouts-->. In pagelayouts you can see your new layoutpage.
choose edit properties of your layoutpage there you can see the properties of that layout page. There is one column called preview image, give the url of image there that you already uploaed in the docu libary. click on Ok, now you have got preview image of your layout page.

浅语花开 2024-09-02 08:44:21

感谢 Rich Bennema 和 Hojo 的回答,这是正确的,但同时,我的问题是部署了此布局,当我再次部署更改 PublishingPreviewImage 时,布局没有更新。所以我的问题是控制事件的问题,以便每次部署时都会重新创建布局,以防发生更改。

我知道这一点,因为它适用于新布局。

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

Thx to Rich Bennema and Hojo for answering, there are right, but at the same time, my problem is that this layouts were deployed, and when I deploy again changing the PublishingPreviewImage, the layout is not updating. So my problem was a problem of controlling events so that everytime that I deploy the layouts are recreated in case there is changes.

This I know because it has worked for new layouts.

So for those who try this. Use the code I have provided with the one of Rich Bennema to upload the image.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文