Hi,
:-)
In the
API examples is a sample code how to do it:
// Get the page template
PageTemplateInfo template = PageTemplateInfoProvider.GetPageTemplateInfo("MyNewTemplate");
if (template != null)
{
int templateId = template.PageTemplateId;
int siteId = CMSContext.CurrentSiteID;
// Save the binding
PageTemplateSiteInfoProvider.AddPageTemplateToSite(templateId, siteId);
I hope it will help.
Best regards,
Juraj Ondrus