You can always use the 'Rollback' feature to compare the current version to previous versions of pages. The user could either cancel the window or select a previous version if a rollback is needed.
Simply right-click on a page and select the 'Rollback' menu item.
In umbraco, every time you make changes to a page and save it, that is a "version".
For example, imagine the 'About Us' page... You have some fantastic text that explains everything there is to know about your company. That's a "version" of your page. Then you hire a new CEO and you update the page in umbraco, save and publish it. You now have two "versions" of your page.
Do you really want to allow outsiders to see the old version as well? Usually not. If you did, you'd need to write a little .net macro that would get the old version(s) from the database and display them. This can be done through the umbraco api.
On the other hand, if you mean you want to show the same 'About Us' page content but in different ways, such as the web version, an RSS version, and an iPhone version... that's not what umbraco calls a "version" but simply an "alternate template". If this is what you want to do look through the forum and wiki for "Alternate Template" or "altTemplate" and you'll get lots of info.
"Do you really want to allow outsiders to see the old version as well?
Usually not. If you did, you'd need to write a little .net macro that
would get the old version(s) from the database and display them. This
can be done through the umbraco api." - this is exactly what my client wants.
I have been searching and searching how to get at the history of my document as I need to compare the content of different versions!
It mentions here that it can be done through the umbraco API.. but How???
All documents in umbraco is versioned. So everytime a document is
changed, a new version is stored seperately. All versions get a unique
Id assigned. The document returned will reflect the state of the
document data in that specific version.
I created function like below to see old version in html
public HttpResponseMessage ViewVersion(int nodeId, string guid)
{
UmbracoContext.Application.ApplicationCache.RuntimeCache.ClearAllCache();
umbraco.library.RefreshContent();
UmbracoContext.InPreviewMode = true;
Guid version = new Guid(guid);
var auth = new HttpContextWrapper(HttpContext.Current).GetUmbracoAuthTicket();
IUser curruser = null;
if (auth != null)
{
curruser = ApplicationContext.Services.UserService.GetByUsername(auth.Name);
}
umbraco.BusinessLogic.User user = new umbraco.BusinessLogic.User(curruser.Id);
var d = new Document(nodeId, version);
var pc = new PreviewContent(user, Guid.NewGuid(), false);
pc.PrepareDocument(user, d, true);
pc.SavePreviewSet();
pc.ActivatePreviewCookie();
var UmbracoHelper = new Umbraco.Web.UmbracoHelper(UmbracoContext);
string result = UmbracoHelper.RenderTemplate(nodeId).ToHtmlString();
return new HttpResponseMessage() { Content = new StringContent(result, System.Text.Encoding.UTF8, "text/html") };
}
Version history
Hi guys,
Is it possibe to allow users to view page history?
I was thinking maybe a list of links pointing to older versions of a page?
Any help would be much appreciated.
Thanks
Scott
You can always use the 'Rollback' feature to compare the current version to previous versions of pages. The user could either cancel the window or select a previous version if a rollback is needed.
Simply right-click on a page and select the 'Rollback' menu item.
cheers,
doug.
What I actually mean is show different version of the page to the public - is this possible?
Cheers
Scott
In umbraco, every time you make changes to a page and save it, that is a "version".
For example, imagine the 'About Us' page... You have some fantastic text that explains everything there is to know about your company. That's a "version" of your page. Then you hire a new CEO and you update the page in umbraco, save and publish it. You now have two "versions" of your page.
Do you really want to allow outsiders to see the old version as well? Usually not. If you did, you'd need to write a little .net macro that would get the old version(s) from the database and display them. This can be done through the umbraco api.
On the other hand, if you mean you want to show the same 'About Us' page content but in different ways, such as the web version, an RSS version, and an iPhone version... that's not what umbraco calls a "version" but simply an "alternate template". If this is what you want to do look through the forum and wiki for "Alternate Template" or "altTemplate" and you'll get lots of info.
cheers,
doug.
Thanks Doug - fantastic reply :)
"Do you really want to allow outsiders to see the old version as well? Usually not. If you did, you'd need to write a little .net macro that would get the old version(s) from the database and display them. This can be done through the umbraco api." - this is exactly what my client wants.
Thanks for the help mate.
Scott
Is anyone still looking at this very old post?
I have been searching and searching how to get at the history of my document as I need to compare the content of different versions! It mentions here that it can be done through the umbraco API.. but How???
I am using 6.1.6 can anyone help?
For anyone else who is looking:
http://our.umbraco.org/documentation/Reference/management/Documents/
Good ol' google search!
Is it possible to create the page in HTML for this Document d?
I created function like below to see old version in html
is working on a reply...