Whilst reading Maurice Prather’s blog (BlueDog Limited) I was reminded of something I’d seen at the SharePoint Conference 09 but hadn’t had a chance to look at yet – namely that web parts now support versioning.
In MOSS this caused quite a few headaches in WCM scenarios, particularly in solutions with page layouts that had a mix of both field controls and web parts zones. In these cases some of the content on the page could be rolled back via the version history, but other parts couldn’t. Not great from the user’s perspective.
In SharePoint 2010 this looks to have been resolved in the most part and I tried it out like so:
- First I created a publishing portal site collection (note web part versioning is no different, in that it relies on the version settings of the pages library; hence it’s in action on an OOB publishing site).
- Next I modified one of the web parts on the page – a Summary Links Web Part in this case – and published/ approved the page to make it a major version.
- I repeated the above to add yet another version to the page.
- Now with my version history created on the page, I used the new Version Diff button on the ribbon to view the previous versions.
- This page (/_layouts/VersionDiff.aspx) gives me some nice functionality for comparing one version with any of the previous versions. Interestingly the message on the page still states that changes to Web Parts will not be shown – but then it is still in beta! From the screenshot below you can see that the web part changes I made have been captured.
- Next I tried to restore the first version of the page. For some reason this wouldn’t work, but I’m hoping/ assuming this was me doing something daft, or else just a beta bug. I did manage to restore any of the other versions though. To do this I followed the ‘Restore this Version’ link from the Version Diff page and then used the context menu on the particular version I wanted to restore.
I’ve also tried this out on a regular blank site – so without the publishing feature enabled. Whilst the home page (default.aspx) isn’t in a library of it’s own, and therefore there is no version history, once a new page has been created a Site Pages library is created and pages within this library will have version history.
Maurice’s blog includes a couple of points to consider around versioning, in that version history will not be kept if editing personalized web parts or on a page that is not checked out.