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)
- 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.
- Number of versions of an item should not be more than 10. You can manage version number by shared source module- http://trac.sitecore.net/VersionManager
- For content editor, hide standard fields to 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.
- 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.
- 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.
- 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.
- Sitecore recommends to configure and tune the Sitecore database caches — prefetch, data, and item. Use the below link for the same. http://sdn.sitecore.net/upload/sitecore6/sc62keywords/cache_configuration_reference_us.pdf
- Cache the expensive logic and components that are retrieved frequently http://sdn.sitecore.net/upload/sitecore6/64/presentation_component_reference-usletter.pdf
- Limit the number of layouts in favor of sublayouts. The aim should be to have one layout per site per device
- Assign presentation details on the _standard values whenever possible
- To enable experience editor use FieldRenderer or the other Sitecore presentation controls.
- Use image scaling and resizing for smaller or thumbnail from large image.
- Make sure to use the DataSource .This facilitates creating multi-variant tests (A/B) and personalization rules.
- Use presentation components parameters to change the behavior of components in term of look and feels etc.
- Make sure to create a template for any parameters in the presentation component, and set the Parameters Template Property.
8. Page Editor
- Sitecore recommend to enable and configure page editor for non-technical content editor.
- Configure the placeholder settings so that users are able to add the right components to the page.
- Consider using the Page Editor buttons, and the Datasource Location, and Datasource Template fields
9. Solution Code
- Sitecore highly recommend do coding in C#.
- Use GUIDs where possible instead of path / name. This will improve performance, as well as prevent any breakage if you move content to a new location in the content tree.
- Use patch file in App_Config/Include rather than directly modifying web.config file.
10. System Architecture
- The Web server(s) should run IIS 7.x with the latest security updates
- You use IIS 7.x in integrated mode.
- The Web and Database servers should be on separate computers.
- Implement maintenance plans to defragment indexes on the core, master, and web databases on a scheduled basis on SQL Server
- Enable static content compression in IIS
- Make sure that the content expires header is set in the common headers, particularly for the /sitecore folder in IIS
- Refer the links https://kb.sitecore.net/articles/087164 for sitecore compatibility of OS, database and .Net framework with Sitecore versions.