Monthly Archives: November 2018

Sitecore Template

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.

Other words

  • 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)

How can you get the best out of Sitecore?

Get the website requirment, analyze the site’s requirements, breakdown into smaller entities, using entities build normalized sitecore data template, then work further understand the content structure.

To build good template, should aware of below checklist

– Based on the site’s requirment think about entities and fields.
– Group all releted fields under logical section.
– Identify all common fields and create a base template.
– Field name used should be easily understand by business users.
– “Display Name” property to provide friendly name to an item.
– Always set default values in standard values.
– Apply Icon to templates, so that it is easy to recognize.
– Presentation should be configured in standard values.
– Utilize branch templates for predefined structure creation.

Content Structure:
Once the templates have been created, you need to begin work on creating Content Item in content tree.

– As a standard, try not to have more than 100 items under particular node. If expecting more than 100, then consider using buckets or create folders in a way that it doesn’t exceed more then 100 child per folder/item.
– Try to have only page items created under home page.
– Make sure we have security added for items based on user access roles.
– For faster access index should be configured.
– Also maintain minimal version for each item.


Now the content structure is ready, let’s get started on creating the presentation

– Make sure all the LAYOUTS are created under ‘/Sitecore/Layout/Layouts’, can also create sub folders if needed with access limitation.
– For each device layout should not have more than 3 layouts structure.
– Layout details should be assigned in standard values and not in Template/Item level.
– Use Field Renderer object to render the fields on presentation.
– Caching options should be configured whenever the controls are used, based on the control definitions.



%d bloggers like this: