User:QuickNick/EventTrackVariants2

} The current    script is passed just the variant name so it is possible for editors to unwittingly use the incorrect track variant  e.g. national instead of the national ! This script is passed both the track and variant which ensures the variant is specific to the track AND allows for editorial mistakes AND variants with the same name.

Usage:


 * If there is no variant for the specified track the script ignores the passed-in variant and returns/outputs nothing e.g.  =
 * If there is only one variant for a track the script ignores the passed-in variant and returns the actual variant e.g.  =
 * If the passed-in variant is invalid, it is output in red.
 * It would be easy to change this so that it outputs a default variant BUT it is probably better that it highlights the mistake so it can be corrected.

Examples

In the examples below I am making use of   which is a template I recently added which acts as a sub-template to    ... If you look at this script you will see that I've made use of both of the above scripts!
 *   returns the "corrected" track name to ...
 *   returns the linked track.

Passing track and variant to a script ...

--





and with incorrect data ...



Just in case the calling script didn't use

Tracks and Variants