Steve
-
6/16/2011 11:55:14 PM
RE:Using API to create page based on adhoc template
Hi Radek,
Of course (I forgot I had posted here!). The solution which worked perfectly...
The code that you can use to clone the template as ad-hoc can be found in the btnClone_Click method in the following file ~\CMSModules\Content\CMSDesk\Properties\Template.aspx.cs.
In general, all you need to do is to get the the object of PageTemplateInfo class that represent the template you want to clone and then use the following code:
PageTemplateInfo newInfo = PageTemplateInfoProvider.CloneTemplateAsAdHoc(pldInfo, displayName, CMSContext.CurrentSite.SiteID); PageTemplateInfoProvider.SetPageTemplateInfo(newInfo);
Hope that helps others
Steve
|