Template documentation follows
Note: the template above may sometimes be partially or fully invisible.
Visit Template:EventTrackVariants/doc to edit this documentation. (How does this work?)

Description

The current {{EventTrackVariants}} 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

{{EventTrackVariants|Track=track|Variant}}
{{EventTrackVariants|Track=track|Variant=variant}}

{{EventTrackVariants|variant}}
{{EventTrackVariants|Variant=variant}}

Exceptions

  • If there is no variant for the specified track the script ignores the passed-in variant and returns/outputs nothing e.g. Circuit de Spa-Francorchamps =
  • If there is only one variant for a track the script ignores the passed-in variant and returns the actual variant e.g. Brands Hatch = Indy Circuit

Examples

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

Specifying Track and Variant

{{EventTrackVariants|Track={{EventTrackNames|monza}}|Variant=road}}

Road Course

Specifying only the Variant

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

{{EventTrackVariants|club}}
{{EventTrackVariants|GP}}
{{EventTrackVariants|grand prix}}
{{EventTrackVariants|INDI}}
{{EventTrackVariants|Variant=National}}
{{EventTrackVariants|The National}}
{{EventTrackVariants|oval}}
{{EventTrackVariants|Bridge}}
{{EventTrackVariants|short}}
{{EventTrackVariants|Variant=(short)}}
{{EventTrackVariants|sud}}
{{EventTrackVariants|}}
{{EventTrackVariants|WIBBLE}}

Club Circuit
GP Circuit
Grand Prix Circuit
Indy Circuit
National
The National Circuit
Oval Circuit
The Bridge Grand Prix Circuit 2009
Short
On-road Circuit (Short)
Südschleife National Circuit
     (Correct. No variant specified so nothing returned e.g. Spa
WIBBLE

But, as mentioned above, it is easy to select the incorrect track variant, is it short or (short) !?!

{{EventTrackVariants|short}}
{{EventTrackVariants|(short)}}

Short
On-road Circuit (Short)

whereas if you specify the track

{{EventTrackVariants|Track={{EventTrackNames|hock}}|short}}
{{EventTrackVariants|Track={{EventTrackNames|leipzig}}|short}}

Short
On-road Circuit (Short)

Invalid Values

Invalid values are output in red ...

{{EventTrackVariants|wibble}}

Invalid Variant ... wibble

{{EventTrackVariants|Track={{EventTrackNames|monza}}}}

Valid Track, missing Variant ... ???
Note: For a track which has no/one Variant, e.g. Melbourne, this will be ok.

{{EventTrackVariants|Track={{EventTrackNames|monza}}|}}

Valid Track, blank Variant ... ???
Note: For a track which has no/one Variant, e.g. Brands Hatch, this will be ok.

{{EventTrackVariants|Track={{EventTrackNames|suzuka}}|South}}

Valid Track, invalid Variant ... South

{{EventTrackVariants|Track=wibble|Variant=wobble}}

Invalid Track ... Track = wibble, Variant = wobble

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 {{EventTrackNames}} template to set the correct Track name and then pass this value to the {{EventTrackVariants}} template to set the correct Variant name.

{{YourScript|Track=cat|Variant=gp}}
------
YourScript
{{#vardefine:trackname|{{EventTrackNames|{{{Track|}}}}}}}
[[{{#var:trackname}}]]
<br>
{{EventTrackVariants|Track={{#var:trackname}}|Variant={{{Variant|}}}}}

Circuit de Catalunya
GP Circuit

and with invalid data ...

{{YourScript|Track=wibble|Variant=wobble}}

???
Track = ???, Variant = wobble

{{YourScript|Track=SilverStone|Variant=wobble}}

Silverstone
wobble

Tracks and Variants

Autodromo Nazionale Monza

{{EventTrackVariants|Track={{EventTrackNames|monza}}|Variant=junior}}

Junior Course

{{EventTrackVariants|Track={{EventTrackNames|monza}}|road}}

Road Course


Brands Hatch

{{EventTrackVariants|Track={{EventTrackNames|brands}}}}

Indy Circuit


Circuit de Catalunya

{{EventTrackVariants|Track={{EventTrackNames|catalunya}}|Variant=club}}

Club Circuit

{{EventTrackVariants|Track={{EventTrackNames|catalunya}}|gp}}

GP Circuit

{{EventTrackVariants|Track={{EventTrackNames|catalunya}}|Variant=national}}

National Circuit


Circuit de Monaco

{{EventTrackVariants|Track={{EventTrackNames|monaco}}}}

Grand Prix Circuit


Circuit de Spa-Francorchamps

{{EventTrackVariants|Track={{EventTrackNames|spa}}}}


Circuit des 24 Heures

{{EventTrackVariants|Track={{EventTrackNames|le mans}}}}


Circuit of The Americas

{{EventTrackVariants|Track={{EventTrackNames|cota}}|Variant=club}}

Club Circuit

{{EventTrackVariants|Track={{EventTrackNames|cota}}|Variant=national}}

National Circuit

{{EventTrackVariants|Track={{EventTrackNames|cota}}|Variant=gp}}

Grand Prix Circuit


Daytona International Speedway

{{EventTrackVariants|Track={{EventTrackNames|daytona}}|motorcycle}}

Motorcycle Course

{{EventTrackVariants|Track={{EventTrackNames|daytona}}|Variant=road}}

Road Course

{{EventTrackVariants|Track={{EventTrackNames|daytona}}|oval}}

Speedway


Dubai Autodrome

{{EventTrackVariants|Track={{EventTrackNames|dubai}}|club}}

Club Circuit

{{EventTrackVariants|Track={{EventTrackNames|dubai}}|Variant=gp}}

Grand Prix Circuit

{{EventTrackVariants|Track={{EventTrackNames|dubai}}|hill}}

Hill Circuit

{{EventTrackVariants|Track={{EventTrackNames|dubai}}|international}}

International Circuit

{{EventTrackVariants|Track={{EventTrackNames|dubai}}|Variant=national}}

National Circuit

{{EventTrackVariants|Track={{EventTrackNames|dubai}}|oval}}

Oval Circuit


Formula E Hong Kong Circuit

{{EventTrackVariants|Track={{EventTrackNames|hong kong}}}}


Hockenheimring

{{EventTrackVariants|Track={{EventTrackNames|hockenheim}}|gp}}

Grand Prix Circuit

{{EventTrackVariants|Track={{EventTrackNames|hockenheim}}|national}}

National

{{EventTrackVariants|Track={{EventTrackNames|hockenheim}}|short}}

Short


Indianapolis Motor Speedway

{{EventTrackVariants|Track={{EventTrackNames|indianapolis}}|Variant=road}}

Road Course

{{EventTrackVariants|Track={{EventTrackNames|indianapolis}}|speedway}}

Speedway


WeatherTech Raceway Laguna Seca

{{EventTrackVariants|Track={{EventTrackNames|laguna seca}}}}


Melbourne

{{EventTrackVariants|Track={{EventTrackNames|melbourne}}}}


Mount Panorama

{{EventTrackVariants|Track={{EventTrackNames|bathurst}}}}


Nürburgring

{{EventTrackVariants|Track={{EventTrackNames|nurburgring}}|gp}}

Grand Prix Circuit

{{EventTrackVariants|Track={{EventTrackNames|nurburgring}}|Variant=mull}}

Müllenbachschleife

{{EventTrackVariants|Track={{EventTrackNames|nurburgring}}|sprint}}

Sprint Circuit


Porsche Test Track

{{EventTrackVariants|Track={{EventTrackNames|ptt}}|dynamic}}

Dynamic Circuit

{{EventTrackVariants|Track={{EventTrackNames|ptt}}|short}}

On-road Circuit (Short)

{{EventTrackVariants|Track={{EventTrackNames|ptt}}|long}}

On-road Circuit (Long)


Red Bull Ring

{{EventTrackVariants|Track={{EventTrackNames|rbr}}|Variant=gp}}

Grand Prix Circuit

{{EventTrackVariants|Track={{EventTrackNames|rbr}}|Variant=national}}

Südschleife National Circuit


Richmond International Raceway

{{EventTrackVariants|Track={{EventTrackNames|richmond}}}}


Silverstone

{{EventTrackVariants|Track={{EventTrackNames|silverstone}}|bridge}}

The Bridge Grand Prix Circuit 2009

{{EventTrackVariants|Track={{EventTrackNames|silverstone}}|gp}}

The Grand Prix Circuit

{{EventTrackVariants|Track={{EventTrackNames|silverstone}}|Variant=international}}

The International Circuit

{{EventTrackVariants|Track={{EventTrackNames|silverstone}}|national}}

The National Circuit


Suzuka Circuit

{{EventTrackVariants|Track={{EventTrackNames|suzuka}}|east}}

East Circuit

{{EventTrackVariants|Track={{EventTrackNames|suzuka}}|gp}}

Grand Prix Circuit

{{EventTrackVariants|Track={{EventTrackNames|suzuka}}|west}}
West Circuit
Community content is available under CC-BY-SA unless otherwise noted.