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

CreateCSharpDeveloperTemplate

Create a developer template file with the given label in the given location. These are templates that run on their own like assets. They are commonly used for CSS or JS files.

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


Returns

A newly created C# developer template.

Parameters

NameDescriptionType
label The label to use System.String
parent The folder where the developer file is to be created. CrownPeak.CMSAPI.Asset

Code Example

C#

Sample:
Asset parent = asset.Parent;
string label = "CPTest.css";

Asset newAsset = Asset.CreateCSharpDeveloperTemplate(label, parent);
if(newAsset.IsLoaded)
{		
  string strBody = newAsset.Raw["body"];
  strBody += ".classname { color: #000000 }";
  newAsset.SaveContentField("body", strBody);
}

Connect with Crownpeak