API
Version 7.x > API > Cloning page template View modes: 
User avatar
Member
Member
Yehuda - 2/16/2014 12:47:48 PM
   
Cloning page template
Hi,

I'm trying to clone page templates in code. How do I achieve that?
I need just a simple example.

Currently I use:
PageTemplateInfo template = PageTemplateInfoProvider.GetPageTemplateInfo("xxx");
var repeaterWebPart = template.GetWebPart("xxWebPart");
repeaterWebPart.SetValue("wherecondition", string.Format("TagID = {0}", row.Field<int>("TagID")));
template.CodeName = "xxx" + "." + row.Field<int>("TagID");
template.DisplayName = "xxx" + " " + tagName;
PageTemplateInfoProvider.SetPageTemplateInfo(template);

But this updates the template, it doesn't insert a new one, and I'm trying to find a method to insert, not update.

User avatar
Member
Member
Yehuda - 2/16/2014 12:56:57 PM
   
RE:Cloning page template
Figured it out. That was easy.
If someone else looks for that info, basically you have to make a new PageTemplateInfo,
and then copy/change the required properties.