Hi, I need to get all dates and people modifications to currenlty displayed page, all changes which have been published and end user can see difference between them. My page is aspx connected to pageLayout in which is richhtmlfield with article. How to do that? Is it possible to do that ?
A:
If this is for Contributors while the page is in edit mode, they can select Tools > Version History from the toolbar. Otherwise, you can add a link on the page to Versions that is available to all users:
<a href="/sites/mysite/_layouts/Versions.aspx?list=[GUID]&ID=[ID]&FileName=%2Fsites%2Fmysite%2FPages%2FcurrentPage%2Easpx>Modifications</a>
You will need to fill in the values of the list, ID, FileName parameters manually. To generate the link automatically, I would build a custom page layout that generates the URL in Page_Load as follows:
RevisionHistoryAction versions = new RevisionHistoryAction();
string url = versions.NavigateUrl;
RevisionHistoryAction is in the Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions namespace.
Rich Bennema
2010-04-07 14:23:53
Thaks! So I could access the list progamatically and retrieve all entries and then display in my own way in my own control.If I have my aspx file on the screen and I want to access the versions list - what would be GUID and ID providing I am able to retrieve current page by SPContext.Current.File ?Then SPFile has Versions member - is it the same list that this from the link?
2010-04-07 19:00:44
If you want to create your own control, I would take some time looking at Versions.aspx in the 12 hive under 12\TEMPLATE\LAYOUTS\Versions.aspx. You will also want to look at the VersionsPage class in Reflector. You can find the DLL in 12\CONFIG\BIN\Microsoft.SharePoint.ApplicationPages.dll.
Rich Bennema
2010-04-07 20:12:40