Documentation > CMS Template API Library > Asset > CreateTemplateFolder(String,Asset)

CreateTemplateFolder

Create a template folder with the given label in the given location. It must be created in another template folder.

public CrownPeak.CMSAPI.Asset CreateTemplateFolder(String,Asset)


Returns

A newly created template folder.

Parameters

NameDescriptionType
label The label to use System.String
parent The folder where the template folder is to be created. Must be another template folder. CrownPeak.CMSAPI.Asset

Code Example

C#

Sample:
string label = "Template Folder Name";
Asset parent = Asset.Load("/" + asset.AssetPath[0] + "/Project/Templates/");
if(parent.IsLoaded)
{
  Asset newTemplateFolder = Asset.CreateTemplateFolder(label, parent);
  if(newTemplateFolder.IsLoaded)
  {
    // Do Something
  }
}

Connect with Crownpeak