Sitecore 5.0 API

Item.ChangeTemplate Method 

Changes the template of the item.

[Visual Basic]
Public Sub ChangeTemplate( _
   ByVal template As TemplateItem _
)
[C#]
public void ChangeTemplate(
   TemplateItem template
);

Parameters

template
The new template.

Remarks

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.

Field values are transfered by name, so that fields that occur in both templates are preserved.

See Also

Item Class | Sitecore.Data.Items Namespace