Copy Template

Posted by Community Admin on 05-Aug-2018 09:22

Copy Template

All Replies

Posted by Community Admin on 08-Dec-2010 00:00

Hi,


Is there (or will there be) any way to copy (duplicate) a page template?
I haven't found anything in SDK.
What about saving a page as template (could be a nice feature in some cases)?

Thanks
Udo

Posted by Community Admin on 08-Dec-2010 00:00

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;


Regards,
Ivan Dimitrov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.

Posted by Community Admin on 09-Dec-2010 00:00

Hi Ivan,

it seems to work.

Thanks a lot!

Posted by Community Admin on 20-May-2013 00:00

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

Posted by Community Admin on 23-May-2013 00:00

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

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

This thread is closed