In web development Template represent Views, Partial views, User control, or static pages. But in Sitecore Template terminology is not same as above. Here template is something like Class in OOPS. Template can be Viewed/Created with in Template node in the navigation tree. Just as a class has properties that define its properties, every piece of content in Sitecore will have a data template to define the properties it contains.
- Template in an sitecore is an item, which defines behavior and structure of other items.
- Every item in sitecore is an instance of some template.
There are 3 type of Template
1) Data template
2) Branch template
3) command template
Recommendations when Creating Templates
- Interface template – contains fields, the convention is such that it begins with _, in C# it is an equivalent to interfaces.
- Page type template – can have a layout, does not contain fields, inherits from one or more interface templates, instances are created from it, in C# it is equivalent to a class that implements one or more interfaces.
- Datasource template – do not have layouts even though they are also inherited from the interface template, they are only used for referenced items as data-source for renderings.
- Settings template – templates define the settings for the implementation of business logic, do not inherit from the interface template and are directly instanced.
- Folder template – Do not use Common/Folder! Have your own folder template for every module. Thanks to this, you will be able to modularize the solution and use various insert options, authorizations, etc. on the file.
- Parameter templates – Like any standard data template that would be created in Sitecore, you start by creating a new template and extending an existing Sitecore template: Standard Rendering Parameters
FULL PATH: /System/Layout/Rendering Parameters/Standard Rendering Parameters Do not use the Shared or Unversioned field unless it is absolutely necessary. It is always necessary to consider the language and cultural context carefully.
Data Definition = templates (Schema)
Content = items (Template is used to get relevant data as items)
Presentation = layouts and components (Transform the data into HTML format)