Reputation: 8616
In the Sitecore workbox there is a pop-up to view item versions and compare item versions. It uses the following code (Found this in the Workbox module):
protected void Diff(string id, string language, string version)
{
Assert.ArgumentNotNull((object)id, "id");
Assert.ArgumentNotNull((object)language, "language");
Assert.ArgumentNotNull((object)version, "version");
UrlString urlString = new UrlString(UIUtil.GetUri("control:Diff"));
urlString.Append("id", id);
urlString.Append("la", language);
urlString.Append("vs", version);
urlString.Append("wb", "1");
Context.ClientPage.ClientResponse.ShowModalDialog(urlString.ToString());
}
I want to display the same pop up for one of my custom control in an IFrame. Is this the recommended way to ise it, or are there any other methods available from the API?
Upvotes: 0
Views: 123
Reputation: 27132
I don't think that Sitecore developers created this code hoping that one will reuse this in the custom controls. Still if you need this, then I totally agree that the best option is to reuse this code - this popup is for sure well tested by the Sitecore team so can take it for granted that it works fine.
And as far as I'm aware, there is no API call for comparing item versions in Sitecore.
Upvotes: 1