We have a publishing site with variations. There is a dev server and a stage server and the content is pretty much same in both. Recently I was editing one of the webpart content pages in the dev server via SPD 2010 and it opened the page layout for that page from the stage server. I digged around a bit and after a few powershell executions, found that the publishing page xml content has two references to the stage server:

$web = get-spweb($url0)
$pweb = [Microsoft.Sharepoint.Publishing.PublishingWeb]::GetPublishingWeb($web)
$ppage = $pweb.GetPublishingPage($page0)
$layout = $ppage.layout

The Xml starts like <z:row xmlns:z='#RowsetSchema' ... "

I tried updating PreviewImageUrl (via page checkout, checkin) by removing the hardcoded stage server reference and the update was never succcessful.

The Xml contained two hard-coded references to our stage server in the PublishingVariationRelationshipLinkFieldID and PublishingPageLayout fields, which I'm not sure how to update.

I looked at the "RelationShips List" in which the references are relative.

Any ideas to update the xml via powershell or UI?


How do you know it loaded the layout from the stage server when the content is identical? You will never edit a content page from SPD, only page layouts, which you edit from the masterpage gallery on the relevant server.

Also, you cannot update the XML you see there, it's read only.

Have you tried manually re-assigning the page layout for the pages via the web UI?

  • When I open a webpart page in dev server, SPD asks me to authenticate to stage server, then checksout and opens the page layout from the stage server (stageserver on the windows title bar). The ListItem.Xml property among the other values contains these two: PublishingVariationRelationshipLinkFieldID:SW|stageserver/Relationships%20List/147_.000, /Relationships List/147_.000&#13;&#10 PublishingPageLayout:SW|stageserver/_catalogs/masterpage/Custom_page_layout_1.aspx, &#13;&#10; I will try manually re-assigning the page layout. – vasya10 Apr 26 '11 at 18:31
  • Right, so the answer here is to do with the fact that you published a variation of that page on the staging server before you migrated the data to your dev server. what I recommend you do is to attempt to re-publish all the variatons on your dev server to fix the relationship table. – James Love Apr 26 '11 at 19:24
  • @James thanks for the tip. I think I understand it better now. I re-applied the page layout manually on devserver and inspected the Xml, now it shows PublishingPageLayout:SW|devserver/_catalogs/masterpage... We have several such pages, is there an easy way to republish all the variations, using a powershell script? – vasya10 Apr 26 '11 at 19:48
  • Unfortunately not, the variations system is pretty tightly sealed - but what you could do is just iterate over all the Pages in SitePages (or whereever the publishing pages are kept) and re-Publish them (by calling Page.Publish()) - timer job should kick in and update the target variations and thus update the properties. – James Love Apr 26 '11 at 20:01
  • @James, thanks that helped.. the Publish method was part of ListItem.File, so I had to do $page.ListItem.File.Publish() followed by Approve. But there is one issue, after I publish, the above said properties are reset, but the contents of the variation page is also reset to the content of the source language. Does this mean do I have to recreate the content in the variation sitepage? Is there a way to prevent the contents being replaced? – vasya10 Apr 26 '11 at 23:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.