Sitecore Field Source as XPath, Query or FastQuery Cheat Sheet

Being a developer I always like to have handy quick reference guides (so called cheat sheets) to whom I can refer and clear few of my simple concepts. This post is about a cheat sheet informing about Sitecore fields that support XPath, Sitecore Query and Sitecore Fast Query syntax in the source field.

Before we move on to details about Sitecore Field Source as XPath, Query or FastQuery Cheat Sheet I would like to reference few already available cheat sheets for Sitecore.

An experienced Sitecore developer already understands about the importance of Source field, through which content authors can be restricted or guided to select required Sitecore items only.

For a novice Sitecore developer, I would suggest to refer section “Source Field” of this post.

So here comes the cheat sheet now showing field types that support source as XPath, Sitecore query and Sitecore fast query.

Source-Field-Cheat-Sheet

Note: Other fields like Page Preview, Query Builder not listed in the cheat sheet do not support any of the three above sources hence they are not mentioned.

Source Field

The source property provides information that influences the user interface control associated with the field in the Content Editor. The behavior of the source field depends on the field’s type.

Sitecore-SourceField

Few usages of Source Field

  • For list field types, such as Droplink, the source property indicates a location in the content tree that includes the items included in the list displayed by the field.
  • For image and file types, the source property indicates the start folder displayed in the media library dialog.
  • For rich text field definitions, the item specified in the source property specifies a HTML editor profile controlling the features provided by the editing interface.
  • For selection fields, the field source property may specify a Sitecore query using the “query:” prefix before the actual query statement. For e.g. query:/sitecore/content/*/*[@@templateid='{76036F5E-CBCE-46D1-AF0A-4143F9B557AA}’]
  • For selection fields, the field source property may also specify a Sitecore fast query using the “fast:query:” prefix before the actual query statement. For e.g query:fast:/sitecore/content/*/*[@@templateid='{76036F5E-CBCE-46D1-AF0A-4143F9B557AA}’]