What are templates in Sitecore?

What are templates in Sitecore?

A template is like a blueprint. It shows how other things should look and work. In Sitecore, there are different kinds of templates. One type is called Data templates. These templates decide how data should be put in. They specify what fields should be there, what type they should be, and what they should be called.

Each data template inherits its sections and fields from its base templates, and Sitecore combines the sections and fields in the data template and all its base templates. It is important to note that:

  • Data templates support sequential and multiple inheritance.
  • Most data templates inherit from the Sitecore standard template, which defines fields common to all items.
  • Changes to a data template appear immediately in all items based on that data template or all items that inherit from that data template.

There are a few types of templates in Sitecore:

  • Data templates: These are like forms that define what fields are needed to enter data. They determine things like what fields should be there, what type they should be, and what they should be called. Essentially, they lay out the framework for each item’s content.
  • Branch templates: These let you create sets of items rather than just one. It’s like a template for a group of items. Sitecore copies the items below this template, including their content, to make new instances.
  • Command templates: These are more advanced and let you insert items using custom logic instead of a fixed structure.

In Sitecore, templates can also be inherited from each other. For instance, a data template might inherit sections and fields from other templates. This means that when you create a new template, you can build on top of existing ones.

All data templates automatically inherit from something called the standard template. This template doesn’t have any fields itself, but it inherits from other templates that do. It’s a way to make sure that all templates share some common features.

One important thing to remember is that you should create all templates in the Master database, not the Core database.

To create a template in Sitecore, adhere to the following steps:

  1. Open Content Editor
  2. Go to Sitecore
  3. Templates

What is Type in Sitecore?

The field type specifies which user interface control the Content Editor displays to accept input for this field and also controls the storage format for this field.

Each field within a template is paired with a specific field type. This field type governs several aspects:

  • The user interface component displayed by Sitecore for that field in interfaces like the Content Editor and the Page Editor.
  • The formatting of the stored value associated with the field.
  • The .NET classes and coding methodologies utilized by developers to retrieve the field’s value, including classes within the Sitecore.Data.Fields namespace, the renderField pipeline, and the FieldRenderer web control.

The following field types are available in Sitecore 10.3:

  • JSS Types: These are field types specifically designed for use within Sitecore JavaScript Services (JSS) applications. They facilitate seamless integration and interaction between Sitecore and client-side JavaScript frameworks using GraphQL.
  • Simple Types: These are basic field types commonly used for storing Checkbox, Date, Datetime, File, Image, Integer, Multi-Line Text, Number, Password, Rich Text, and Single-Line Text data types.
  • List Types: List types include field types that allow for the selection of multiple items from a predefined list, such as Checklist, Droplist, Grouped Droplink, Grouped Droplist, Lookup Name Lookup Value List, Multilist, Multilist with Search, Multiroot Treelist, Name Lookup Value List, Name Value List, Redirect Map, Tag Treelist, Taglist, Treelist, and TreelistEx fields.
  • Link Types: These field types enable the creation of links between different items within the Sitecore content tree, including internal links to other content items, media items, or external URLs. Link Types fields are Droplink, Droptree, General Link, General Link with Search, Version Identity, and Version Link.
  • Developer Types: Developer types consist of field types that offer advanced functionality and customization options for developers, allowing them to extend Sitecore’s capabilities and integrate with custom business logic. Developer Types fields are Database Droplist, Domain Droplist, Grid Parameters, Icon, IFrame, Language Droplist, Site Droplist, Styling Parameters, Tristate, and Rendering Parameters.
  • System Types: These field types are fundamental to Sitecore’s internal operations and include fields used for system metadata, such as Attachment, Custom, Datasource, Internal Link, Layout, Page Preview, Query Builder, Query Datasource, Rendering Datasource, Rules, Security, Template Field Source, and Thumbnail.
  • Deprecated Types: Deprecated field types are those that have been marked for removal or replacement in future versions of Sitecore. It is recommended to avoid using these types in new implementations and to migrate existing instances to supported alternatives. Deprecated Types fields are File Drop Area, HTML, Link, Lookup, Memo, Reference, Server File, Test, Treelist, Treelist with Search, and Value Lookup.


Leave a Reply

Your email address will not be published. Required fields are marked *