Updates to the ColorSource queries in SCORE 2.1

In 2.1, this ColorSource query changed to be more consistent with Sitecore fields that utilize a DataSource query and to allow the use of GetLookupSourceItem rules to map multiple brand and text color lists into a single selection list.

 

In all previous versions of SCORE, the ColorSource query used for a Simple Color Field resolved to a folder, which would be inspected for list items representing color values.

Prior to 2.1, the ColorSource query for a Stripe, Hero, StyleBox and any other components would look like

ColorSource=query:ancestor-or-self::*[@@templateid='{1469DFF6-C07C-4EAA-9E07-2D42D996E57E}' or @@templateid='{95BB3D68-AEAD-4857-9F04-2003A6039AF6}']/*[@@templateid='{857D2D74-0619-435E-926B-6ABFE75C37F0}']/*[@@templateid='{001EFD9F-8428-44A0-9A24-79F5AF6A0FC9}']

The previous version of the query would traverse up the content tree to find the site root, then down into the Selections folder, and into the Brand Colors selection folder.

 

In SCORE 2.1, the ColorSource query has changed to 

ColorSource=query:#selections#*[@@templateid='{001EFD9F-8428-44A0-9A24-79F5AF6A0FC9}']/*

There are 2 notable differences:

1. The use of the #selections# token

The #selections# token in 2.1 maps to a GetLookupSourceItem rule that dynamically maps the query to the selection folder (or folders) mapped to the tenant.

 

2. The /* at the end of the query

Previously, the query only needed to resolve to a folder, but to make the field behave more like built-in Sitecore fields that accept a DataSource query, it was changed in release 2.1

If you have used a Simple Color Field in your own data templates, and used the ColorSource property of the source field to find a folder, you must at least add the /* to the end of the query for it to continue to work.