Coloring the Rack dates for holidays

Top  Previous  Next

With version 4.0 or later, you can create a custom color scheme to change the colors of the date headers on the Rack.  This can be used to highlight holidays or other special events.  You can also create a scheme to color those dates for empty sites, similar to the way weekends are normally shaded in a darker color.

 

There is a sample color scheme that already does this, which you can import from the Color Schemes Setup.  This can save a little work if you like, but you still need to edit the dates used in the conditions and set the colors the way you want.  See the Color Scheme documentation for details on importing.  Note that you would also need to use Select Global Color Schemes as shown in step 6 below to enable the imported scheme(s) to be used on the Rack.

 

To create the scheme from scratch and select it for use on the date headings, follow these steps:

 

1. Go to Maintenance / Advanced Customizations / Color Schemes.

 

2. Click "Add scheme definition", and give it a name like "Rack dates, holidays".  Note that only one Color Scheme can be used to override the rack date headings, so if you have multiple holidays or other reasons to change the date colors, etc. then the rules for all of them need to be defined in this one scheme.

 

3. Make sure the Default scheme is "None".

 

4. Click "Add Color Rule", and give it a name.  This is what will show in the Color Key for this color.  Lets make this one "July 4th weekend".

 

5. Define the text and background colors you want using the "Change Text Color" and "Change Background Color" buttons.

 

6. Define the rule condition using an Expression, which must have a boolean result.  If it's True, then this color will be used.  If it's False, then it will continue on and check the next rule, and so forth.  If no rules are satisfied, then the default color is used (so we don't have to create a rule for that).

 

The context function ThisDate() is used for the date of interest (each column's date).  We just need to compare it to the special dates we want this color, using the syntax or boolean expressions.  In particular, when comparing multiple dates we need to use "OR" operators so it's true if any one of the dates matches.  So if the dates to color are July 4th thru the 6th of 2008, the expression for this condition would be:

 

ThisDate() = {7/4/08} OR ThisDate() = {7/5/08} OR ThisDate() = {7/5/08}

 

Note that it's curly braces around the dates, not parenthesis -- that's the format used to enter date values.  Also, make sure the spaces are only added where shown -- e.g. there should not be a space between "ThisDate" and "()", but there must be spaces around the "=" and the "OR" operators.

 

If you need to specify a broader date range like July 1st thru the 31st , you would use the '>=' and '<=' operators to specify a range, like:

 

ThisDate() >= {7/1/08} AND ThisDate() <= {7/31/08}

 

 

7. Save that rule.  

 

8. Now we need to continue adding other rules to cover any other dates we want to change colors for, so repeat steps 4 through 7 as needed, just changing the name of the rule and the dates as needed.  Any number of dates can be checked in a single rule, just keep repeating the sequence as needed.

 

9. Once the scheme has all the rules and you Save it, there's one more thing you need to do -- make this scheme the default for date headings.  Go to Maintenance / Advanced Customizations / Select Global Color Schemes, and select the scheme you just created in the drop-down list after "Override Dates headings with color scheme:".

 

Now your new colors should be used on date headings of the Rack.

 

 

If you want to also color all of the empty sites on those dates, you need to create another scheme, and select it for the default for open sites:

 

1. Go to Maintenance / Advanced Customizations / Color Schemes.

 

2. Click "Add scheme definition", and give it a name like "Rack open sites, holidays". (As before, you need to use a single scheme for all open-site rules.)

 

3. Make sure the Default scheme is "Open Sites (Rack)".

 

4. Click "Add Color Rule", and give it a name.  Lets make this one "July 4th weekend" to match the previous one.

 

5. Define the text and background colors you want using the "Change Text Color" and "Change Background Color" buttons.

 

6. The Color Rule Condition Expression will be slightly different for this scheme, because we only want to use this color if the site is available (not marked as unavailable).  We can use the ColorStatusSite() function to get the status, and make sure it's not unavailable in addition to checking the dates:

 

ColorStatusSite(ThisSite(), ThisDate(), ThisPeriod()) != 9

AND (ThisDate() = {7/4/08} OR ThisDate() = {7/5/08} OR ThisDate() = {7/5/08})

 

The expression is broken into 2 or more lines for readability here, but it must be continuous (no line breaks) when you enter it.

 

Note that you have to use AND between that function and the dates checking, which also means there must be parenthesis around the rest of the condition to make sure the OR operators are treated properly.

 

7. Save that rule.  

 

8. Now we need to continue adding other rules to cover any other dates we want to change colors for, so repeat steps 4 through 7 as needed.

 

9. Once the scheme has all the rules and you Save it, there's one more thing you need to do -- make this scheme the default for open sites.  Go to Maintenance / Advanced Customizations / Select Global Color Schemes, and select the scheme you just created in the drop-down list after "Override empty sites with color scheme:".

 

Now your new colors should be used on empty sites of the Rack.

 

 


Page URL http://CampgroundMaster.com/help/coloringtherackdatesforho.html

Campground Master Home