changing templates
Hi all
I just:
Changed a couple of pages to use a new template.
Deleted the old template.
When I view the pages all the content has gone, presumably because the placeholders don't match.
When I go to the revision history for the pages I get an ASP.NET error as the template doesn't exist any more.
Not sure how I would want to handle putting content into a different template but it's not great that it vanishes. Presumably it's still in the DB?
Any thoughts?
Matt
Hi mattc,
If the template has been deleted you cannot get the content for it. The versioning data is serialized in [sf_version_chnges]. The data can be deserialized by using GetSpecificVersionByChangeId method of VersionManager
, but since the template has been removed this could also not helps.
var pageManager = PageManager.GetManager();
var versManager = VersionManager.GetManager();
var draft = pageManager.EditPage(itemId,
false
);
pageManager.SaveChanges();
versManager.GetSpecificVersionByChangeId(draft, versionId);
Hi Ivan
Thanks for your reply..
Not ideal then for users who will expect that just changing the template will not result in losing content, although I understand the problem of different placeholders etc etc.
Is there a plan to cope with this in some way in the upcoming versions?
Perhaps a dialog window asking where to put existing content if they change to another template?
Matt
Hi mattc,
We can put some warning messages and user friendly errors, but currently there are no plans to handler the content when a template has been removed. This will be logged in our system and we will consider it as a possible implementation.
Kind regards,
Ivan Dimitrov
the Telerik team
There still doesn't seem to be any warning messages... as I have just discovered! :-( I see it very important that there needs to be a way to preserve the content whilst changing the background template.
In some other CMS I have seen there is a way to drag completed widgets off the page to the side to then reuse at a later date by dragging back on again. Is there a way to do this with Sitefinity?
Thanks....
Hi,
This is not the case with Sitefinity 4.0. However we have very good versioning system, which lets you compare two versions of a page side by side and restore previous versions.
All the best,
Radoslav Georgiev
the Telerik team