Add Color to Your Fields

Color CodesAre there some values that are stored on the student table (or any table) that you would like to stand out? You can add color to your field backgrounds or text. To accomplish this you create a Data Dictionary extension that can be assigned to the reference tables you want to add color to.

Step 1a.  Create a Data Dictionary extension to store a field for the color codes you want to associate another reference code with.

Admin > Data Dictionary > Extensions and select “Add” from the Options menu. I used the following convention for my extension.

Dictionary DetailID: REF-CODE-COLOR
Name: Reference Table – Color Codes

Save the Extension and add a table to the extension. Then add a field to that table. That field is the one we will use to store the list of colors.

Step1b.  Add a Table to the Extension. Click the Tables link on the side-tab and select “Add” from the Options menu.Extended Table

 

Name: Reference Table – Color Codes
Data Table Config > Name:  Reference Code Common

The Data Table Config > Name is the table that we are extending. We are extending the Reference Code – Common data table with a new field, Color. Then any reference table, that has not already been extended, can be extended using this ‘extension’.

Step 1c.  Add the field to your extension. Click the fields link and then click the Add button in the lower right.  This field must have an alias (All aliases in Aspen need to be unique) and have a length of 25. In this case we’re going to use an alias of  ‘ref-code-color’ for our field. Set this field to use the Reference Table of “HTML Color Codes” and enable “List Edit”. Save and Reload the data dictionary.

Step 2a.  Go to the reference table you would like to ‘colorize’.  In this example I’ll use the Gender Codes table. Set the Extended Dictionary of the Gender Codes reference table to the extended dictionary you just created.

Reference Setup

Step 2b.  Use the View Fields field to determine how to colorize your field. You can see where the alias is called from the extension.  Add the “View Fields” field to a field set (e.g. Default Fields), then when you’re editing the “Gender Codes” table detail, select the field set to access View FieldsView fields is a comma-delimited list of text to display next to the reference code.  In this example, we’re creating a span with a white text shadow, using the color code via the alias we used for the background color field in the extended data dictionary, then outputting the code description. So, it’s HTML with commas separating the HTML code from the fields we want to display.

To colorize the background of your field:

<span style="text-shadow; 1px 1px 1px #FFFFFF; background-color:,ref-code-color,;float:left;width:100%;">,rcdCode, - ,rcdDescription,</span>

To colorize the text in the field:

<span style="color:,ref-code-color,;font-weight:bold;">,rcdCode, - ,rcdDescription,</span>
Color Selection

 

Step 2c.  Assign colors to your reference codes.

Add the Color column to your Default field set for codes, or add a new field set for just those reference tables. Use the drop down list to choose colors for each of your fields.  Save your column.

Step 3.  View your data. Don’t overuse or you will lose the effectiveness of using colors!

2 thoughts on “Add Color to Your Fields

  1. Brian Ciccolo

    The “colorize” HTML has been updated slightly: the curly/smart quotes are now plain quotes. The curly quotes were causing a problem in Aspen and the colors weren’t being displayed.

Leave a Reply