Retrieves templates from the database.
A database may define a number of templates.
A template defines the schema of an item. A schema describes which fields an item has and may contain default values for the fields, for instance a layout definition. Fields are grouped into sections that describe related fields. Templates supports inheritance.
Templates can be retrieved either using their ID or a path relative to the template root, e.g. "System/Folder".
This example creates a new item.
public Item AddItem(Item parent, string name) {
Item result = null;
TemplateItem template = Sitecore.Context.Database.Templates["Document"];
if (template != null) {
result = parent.Add(name, template);
}
return result;
}
Database Class | Sitecore.Data Namespace