Copy Template
Hi,
Hello Le Corbu,
There is no facade or public method that you can use to duplicate a template. The current implementation allows you to duplicate PageNodes only. You can use PageManager and its GetTemplate(Guid id) method to get the template you want to duplicate and then create a new template
PageTemplate template =
null
;
masterFilePath = VirtualPathUtility.ToAppRelative(masterFilePath);
var pageManager = PageManager.GetManager();
template = pageManager.CreateTemplate();
template.Name = nameFromOld;
template.Title = nameFromOld;
emplate.MasterPage = masterFilePathFromOld;
Hi Ivan,
it seems to work.
Thanks a lot!
Hello,
I ma trying to achieve the same functionality. Could you please help me with how I can duplicate a template? I am fairly new to Sitefinity and have inherited a client website that requires some changes. Where should i be pasting this piece of code or is there a way to duplicate it from database itself? Please help me with this in detail. I am stuck with this problem since 2 days.
Thanks
Brijesh
Hi,
Even with the latest Sitefinity release duplication of Templates is not possible. The only way you can achieve duplication is to recreate the template manually.
We have a PITS issue opened about this feature request where you can track on its progress and vote to increase its popularity.
Regards,
Stefani Tacheva
Telerik