views:

136

answers:

3

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

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.

Hojo
Thx, but I need to hardcode this.
netadictos
+1  A: 

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>
Rich Bennema
A: 

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.

netadictos