using System; using Composite.Data; using Composite.Data.Types; namespace Composite.Tools.Installation { public class NewTemplate { /// /// This function can be used for new template creation /// /// Passing identifier for this template /// Passing title for this template /// (title corresponds with the name of xml file that contains markup for this template, it stores in App_Data\PageTemplates) /// public static void CreateNewTemplate(Guid gTemplateGuid, string sTitle) { using (DataConnection connection = new DataConnection()) { IPageTemplate data = DataConnection.New(); data.Id = gTemplateGuid; data.Title = sTitle; data.PageTemplateFilePath = String.Format("/{0}.xml", sTitle); connection.Add(data); } } } }