Top Tips to Tame your Templates

Adopting good template design is one of the easiest ways you can improve the editing experience for your Sitecore users. Follow these simple tips for content editor happiness!
05 April 2014

1. Set meaningful icons for templates

This sounds trivial, but it makes life much easier for Sitecore users if you assign useful icons to your templates. Any content items created from a template automatically use the icon assigned to the template. To set a template's icon select the template in the content editor, select the 'Configure' toolbar chunk then click 'Icon'.

2. Create friendly names for template fields by setting the 'Title' property

Expand the template definition item, and the section item, then select the template field definition. Set a new value for the 'Title' field to give a friendly name for your template field. This way you can use PascalCase field names (or whatever you like) when you reference the items in code, but maintain a user-friendly version for your content editors.

3. Assign icons to template sections

This is especially useful if your templates have more than one section, or if you split your templates into simple base templates. Expand the template definition item, select the template section item then select the 'Configure' toolbar chunk then click 'Icon'.

4. Don't repeat the template name in field names

Say you have a template called 'Page'. Don't name your fields PageTitle, PageHeader, PageBody. Instead go for Title, Header, Body.

5. Don't use duplicate field names

Although Sitecore will allow you to create templates with multiple fields of the same name, this is a bad practice. You don't need to do this, so don't! If you have duplicate field names you'd have to use template field IDs to get the correct field values.

6. Define the source for template fields

For link type fields this will prevent users having to browse the whole content tree to select an item and can prevent them selecting inappropriate items.

For rich text fields, the source can be set to a HTML Editor profile in the core database to control the editing functionality available for a rich text field.

For image fields, the source can be set to the relevant branch/folder of the Media Library, so save editors time in digging around the whole media library.

7. Create standard values items for templates

If a template is for a page, always remember to set the presentation on the standard values item so that any new items created will always have layout and sublayouts set up.

Always configure the insert options for your template, so that editors can insert the correct item beneath other items without having to browse through the whole templates branch.

To create the standard values item, select the template, click the 'Builder Options' menu item then select 'Standard Values'.

Tags: Sitecore TemplatesBest PracticesSitecore 101
comments powered by Disqus