Sitecore Best Practices

Sitecore best practices are designed for the ease of editor, site performance (Sitecore client and website) and site maintainability. This will help Sitecore developers and administrators create optimized websites.

Below are the areas where we need to validate the best practices but this is not complete one, will be evolving in nature.

Templates and _Standard Values

Information / Content Architecture (IA)

Security

Workflow

Media

Caching

Presentation

Page Editor

Solution Code

System Architecture

1. Templates and _Standard Values

Naming Conventions: Name of templates, its section and field should be simple, relevant and easy to understand. This should be business name which content editor can easily understand. Use the Title field of the definition item to present a different name for the field to the user

Folder Structure for Templates: The folder structure should be such a way that it would easy to navigate. For this create the templates folder like “Base Templates”, “Content Templates”, “Page Templates” etc.

Inheritance: Analyze the site fields and put the common fields and section in “Base Templates” and inherit these to wherever required rather than creating new fields. For example- Create a base template “Navigation” with fields “BrowserTitle”,”BrowserTitle”, “HideInSearch” etc. As these field are required on each and every pages so rather than creating field on each page template just inherit “Navigation” Template on page Template.

Avoid duplicate field name: Don’t create two fields with same name on template and also avoid the duplicity of field name in inheritance chain.

Template Icons: Assign icons on templates which will provide visual clue for content editor on type of item type will get created.

Help Option: Use the Help option in the individual field definition items to provide extra information to users about field.

Standard Values: Assign layout details, insert option, initial workflow on standard value. Use tokens, such as $name, $date to reduce the amount of text that a content author is required to enter when creating a new item.

Image field: While defining a field of type image provide source field, which will take editor to the defined source path in media library on during content editing, not the entire media library.

2. Information/ Content Architecture (IA)

Number of child items of given node should not be more than 100. This will improve the performance.

Don’t put JS or define structure in RTE, this should be part of business logic not of RTE field

For showing big tree use TreelistEx instead of Treelist becuase TreelistEx only computes the tree when you click Edit whereas a Treelist will compute it every time it is rendered.

Structure of item in tree define the URL by default, so keep in mind while creating folders in content tree because that will be part of URL.

Put all the items inside home which have public URL / landing page.

3. Security

Apply security to roles rather than users, if a new user will get added then only need assign the role, the same permission will get applicable for new user.

Limit access to the parts of the content tree that are relevant to the user that is logged into the system. For example, a person who is responsible for news items may not require access to the Event page.

Sitecore client password should not be empty or obvious.

Use admin account for administration purpose only not for content editing etc.

4. Workflow

Sitecore recommend to enable workflow, this will ensure the content will go on live website through a pre-defined approval states. This is useful for auto versioning of item on edit.

Apply appropriate workflow security.

Avoid email notification on every workflow state.

5. Media

The recommended practice says put the media in database, this simplifies publishing and deployment of media assets.

The folder structure of the media library should be organized so that it is easy to navigate for non- technical users.

Media item name should be easy to recognize and understand for business users.

Media items should be optimized, using a graphics program such as Photoshop to decrease the size of a rendered page thereby increasing performance. Use sprite images where ever possible.

Include the path to static media items (header images, CSS files, JavaScript files, and so on.) in the IgnoreUrlPrefixes setting located in the web.config file. This will prevent those media items from being processed through the Sitecore pipelines, improving performance.