changing templates

Posted by Community Admin on 03-Aug-2018 03:56

changing templates

All Replies

Posted by Community Admin on 10-Aug-2010 00:00
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
Posted by Community Admin on 10-Aug-2010 00:00
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);

If you create the same template with the same ContentPlaceHolders you should be able to restore the data from backend UI.

Greetings,
Ivan Dimitrov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Posted by Community Admin on 10-Aug-2010 00:00
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
Posted by Community Admin on 10-Aug-2010 00:00
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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Posted by Community Admin on 23-Jan-2011 00:00
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....
Posted by Community Admin on 26-Jan-2011 00:00
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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
This thread is closed