SharePoint Designer removes tags when saves page layout – “file system” feature workaround

In the current project we are using SharePoint Designer 2007 intensively to create number of PageLayouts, especially to put WebParts there and pre-configure WebParts connections. SPD is not such a bad tool, because there is no alternative for this. But time to time it really buggy and awful that you start thinking if it passed QA team before being released. (event SP1 doesn’t solve a lot of common crucial bugs, which stops you using SPD at all)

The most disgusting stuff of SharePoint Designer is that it formats your pages markup without asking you. And what’s worse it REMOVES some tags. I really can’t understand that behaviour – WHY it removes what you typed when you save document?!

Recently, we stumble over the very nasty thing of SPD – accidental formatting. We have a PageLayout with several web parts on the page and we created <SPWebPartConnections> section to predefine WebParts connections. But whenever you save your document, SPD for some reasons removes some of your <SPWebPartConnections>. We spent about 2 hours to understand any dependencies or logic, but without success. It seems that they have some kind of RAND which selects which of the SPWebPartConnections tags to remove. We tried to install several hotfixes for SPD – but nothing works.

So, the only way is to use other tools, like Visual Studio. But there is a problem. If you are edit your pageLayout in Visual Studio and want to test it, you need to re-deploy your pagelayouts each time, because VS doesn’t support check-in/check-out to SharePoint Content DB.

But there is alternative way to edit your pages and have check-in support from the Visual Studio. SharePoint has very cool “file system” feature. It means that you can navigate to your PageLayouts from explorer,  open them in any editor and save it back. All your changes will be stored in Content DB(!!)

To do this your need to open Windows Explorer and navigate to My Network Places. On the left side you will see the “Add Network Places” item. Open it and type there “http://<yoursite>/_catalogs/masterpage/”,type the name of your network folder like “MySite PageLayouts” and press OK.

Now,if you open the “MySite PageLayouts” item from Windows Explorer->My Network Places you will see the content of your “_catalogs/masterpage/” SharePoint folder. And now your can open your masterPage or PageLayouts in any editor, edit them and save them. All changes will be stored into ContentDB. But don’t forget to checkout your file before editing (via Sharepoint or SPD)

So, this trick allows you to edit any SharePoint files and forget about SharePoint Designer issues

Mirror: SharePoint Designer removes tags when saves page layout – “file system” feature workaround

1 Comment »

  1. Paul Noone Said,

    August 14, 2008@ 11:06 pm      Reply

    Thank God this is a bug. I thought I was simply going mad. 🙂


RSS feed for comments on this post · TrackBack URI

Leave a Comment