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

CreateProject

Create a Project with the given label in the given location.

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


Returns

A newly created project.

Parameters

NameDescriptionType
label The label to use System.String
libraryName (Optional) name of the library folder to create. Defaults to "Library" System.String
saveLocation The folder which is going to be the parent of the project CrownPeak.CMSAPI.Asset

Code Example

C#

Sample:
string label = "CP Project";
string libraryName = "Library";
Asset saveLocation = Asset.Load("/_CPTest/");

if(saveLocation.IsLoaded)
{
  Asset newProject = Asset.CreateProject(label, libraryName, saveLocation);
  if(newProject.IsLoaded)
  {
    // Do Something
  }
}

Connect with Crownpeak