The Percolate campaign calendar allows for coloring campaigns based on custom fields. In order to achieve this functionality on the client side the following steps are used:
You are only looking for color maps with a status of
You are looking for:
You want schema fields that match any of the following types:
A schema field should be shown if the color map contains options for that field.
- Find the metadata on the campaign that matches the selected schema ID.
- In that metadata objects ext locate the item who's key matches the selected field key.
- Get the value for the object you just located. (This is the selected option for the field)
- Find the matching color mappings for that schema ID and field key.
- Loop through those color mappings until you find one who's value matches the value found in the campaigns metadata.
- This color mapping has a color associated with it (as a hex string)
- Use that hex string to display the color.
- If the steps above do not return a match, display the no_value_color for that field.
Note: When trying to locate the correct color for taxonomies look for a color for every term that is chosen until a color is located. If no color is returned begin searching through parents. If all parents are exhausted refer use no_value_color.