Template:EventTrackVariants/doc

Description The current  script is passed only 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. To allow for compatibility with the existing script, you can still use the old syntax and specify only the variant.

Syntax

Exceptions
 * 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.  =

Examples Note: In the examples below I am making use of the  template (which acts as a sub-template to the   template) to ensure the track names are correct.

Specifying Track and Variant

Specifying only the Variant To allow for compatibility with the existing  template you can specify only the non-track-specific variants (and omit the Variant=).

(Correct. No variant specified so nothing returned e.g. Spa But, as mentioned above, it is easy to select the incorrect track variant, is it short or (short) !?!

whereas if you specify the track

Invalid Values Invalid values are output in red ... Invalid Variant ... Valid Track, missing Variant ... Note: For a track which has no/one Variant, e.g., this will be ok. Valid Track, blank Variant ... Note: For a track which has no/one Variant, e.g., this will be ok. Valid Track, invalid Variant ... Invalid Track ...

Passing track and variant to a script Ideally, when editing templates, you will make use of the Track and Variant parameters by first using the   template to set the correct Track name and then pass this value to the   template to set the correct Variant name.

-- YourScript





and with invalid data ...





Tracks and Variants'''