blog
Improving the Authoring Experience with Sitecore Field Label Decorators

On any Sitecore project, one of the greatest challenges that architects and developers face is keeping things simple for the Content Author. Today, I will show you how to provide your Content Authors with helpful guidance displayed for each field in the editor, itself, using OOTB features.

Field Label Decorators

Sitecore includes support for adding "help" information to be presented to the Content Author for each field. This help information is displayed in place of or in addition to the field's label (ordinarily, the field's name). I refer these bits of help information as field label decorators.

There are four field label decorators included with Sitecore out of the box:

Decorator If set ... Best Used When...
Title Displays in place of the field's name, similar to the way an item's Display Name displays instead of the item's Name in the tree The field name is formatted or the field was named with developers but not content authors in mind
Short Description Prefixed with " - " and appended to the end of the field label Useful for providing a quick-reference to explain field requirements/validation, how the data in the field will be used, or listing out replacement tokens that the Content Author may use in the field's content
Long Description Displays as hover text when the Content Author's cursor hovers over the field label Useful for providing a detailed reference/description of the functionality, purpose, format, structure, etc. of the field
Help Link Turns the field label into a clickable link Useful for linking to web-based documentation, executing a small JavaScript snippet, or providing a shortcut for sending an email to a support team

Walkthrough

To begin, create a new template and add a field section with an arbitrary name to it. Then, add the field "FeaturedArticles" to the new field section.

New template shown in builder with new field added

Next, navigate to the Template Field item for the new field and enter "Featured Publications" as the Title of the new field.

Template Field of the new field with Title specified

Next, scroll down the page and expand the Help section of the Template Field item. Once there, fill in the value for the Help link, the Long description and the Short description field label decorators.

Template Field of the new field with Help Link, Long Description, and Short Description field values specified

Finally, create a new Content Item that inherits the new template.

Resulting display of rendered field label (without hovering over label) 
Resulting Field Label without Hover 

Resulting display of rendered field label (hovering over label; Long Description showing) 

Resulting Field Label with Hover


Visual Breakdown

In the below image, each of the Field Label Decorators have been identified by name and example:

Resulting display of rendered field label, with all decorators identified and labeled in red


Additional References


0 Comments
Post a Comment