Template:S-line
For new systems and systems in need of maintenance, consider using the newer {{Adjacent stations}} instead. |
This template is called by {{s-rail-national}}; an alias. If a change is made which alters/adds parameters names that template must be updated to reflect the new situation. |
This template employs intricate features of template syntax.
You are encouraged to familiarise yourself with its setup and parser functions before editing the template. If your edit causes unexpected problems, please undo it quickly, as this template may appear on a large number of pages. You can conduct experiments, and should test all major changes, in either this template's sandbox, the general template sandbox, or your user space before changing anything here. |
If you want to disambiguate a station link but don't want to edit the sub-templates, use the parameters |link1=page name (left side) and |link2=page name (right side) to temporarily add the correct link. Another editor should correct the relevant succession templates afterwards, and remove the temporary links. |
S-line is a specialised succession box template that links railway station articles.
Note: this template is called by {{s-rail-national}}; an alias. If a change is made which alters/adds parameters names that template must be updated to reflect the new situation.
Usage
changeS-line must be encased within {{s-rail-start}} and {{s-end}}. The use of {{s-rail}} is highly recommended but not required.
S-line has the following parameters:
Parameter | Description | Notes |
---|---|---|
system | The system to which the line belongs | This should correspond to an entry in Template:S-rail/lines |
line | The name of the line | This should be obvious shorthand (e.g. Orange for Orange Line) |
previous | The name of the previous station | |
next | The name of the next station | |
type | The left-hand line branch | Optional |
type2 | The right-hand line branch | Optional |
note | Information about the left-hand line branch | Optional |
note2 | Information about the right-hand line branch | Optional |
notemid | Information about the station itself | Optional |
oneway1 | Indicates that trains do not operate towards the Previous station | Optional |
oneway2 | Indicates that trains do not operate towards the Next station | Optional |
rows1, hide1 | Used to have the Previous Station box cover multiple lines. See below for details. | Optional |
rows2, hide2 | Used to have the Next Station box cover multiple lines. See below for details. | Optional |
rowsmid, hidemid | Used to have the middle (Line) box cover multiple lines. See below for details. | Optional |
transfer | Used to show lines available by direct transfer at an adjoining station. See below for details. | Optional |
branch | Used to denote specific line branch information, in lieu of or in addition to the type parameters. |
Optional |
state1, state2 | Allows the passing of an additional station parameter. Useful for disambiguation. | Optional |
through1, through2 | Allows, instead of a next station, service passing to another line on the system. | Optional |
Making it work
changeS-line depends on sub-templates for the proper display of information. For an example, here are the templates necessary to properly display this box (a version of which is at Vauxhall station):
Preceding station | London Underground | Following station | ||
---|---|---|---|---|
towards Brixton | Victoria line | towards Walthamstow Central |
First of all, here's the underlying code:
{{s-rail-start}} {{s-rail|title=LUL}} {{s-line|system=LUL|line=Victoria|previous=Stockwell|next=Pimlico}} {{s-end}}
Template:S-rail-start is a variant of the generic template {{s-start}} used to begin thousands of succession boxes. Important note: No form of start template ({{s-rail-start}} or {{s-start}}) is needed when the succession box is inside the service parameter of {{Infobox station}}. Template:S-rail is used to generate headings for each grouping of rail services in a box. Here we have only one, but some particularly large terminals may have three or four (see Union Station (Chicago) or 30th Street Station). S-rail uses the translation table at Template:S-rail/lines; if the entry is undefined, it simply links the text. Therefore, Amtrak produces Amtrak, while LUL gives London Underground.
You can see that S-line takes only parameters – no linking necessary! S-line accomplishes this through two assumptions: (1) groups of articles on train stations are named in a predictable manner; (2) redirects are cheap. For S-line to produce the table above five separate templates were defined. Before discussing them, however, let's review the parameters:
- SYSTEM: The company or grouping to which the line belongs. This is case-sensitive and must be consistent. In this case, the value is LUL.
- LINE: The line name. This is also case-sensitive and must be consistent throughout. Here, we're describing the Victoria Line.
- PREVIOUS and NEXT: The names of the previous and next stations on the line. Current convention suggests West/East Left/Right, followed by North/South, but your mileage may vary. Whenever possible, succession boxes should make geographic sense (i.e. don't have one line running west-east and the other east-west).
You need templates to define the following things: the formatting/linking of the line, the formatting/linking of the previous and next stations, the display of the line's color, and the display of the appropriate termini – all automatic.
Line
change[[Template:{{{SYSTEM}}} lines]] (Template:LUL lines)
This template carries a translation table for the formatting/linking of the line. The template receives one parameter, {{{1}}} from S-line. With systems that have unusual or non-uniform naming, like Amtrak, it may be necessary to have a test case for every line. When a system has uniform naming, you may be able to get away with a default case and only one or two exceptions, as in Template:LUL lines:
{{#switch:{{{1}}} | #default=[[{{{1}}} Line]] }}
Station
change[[Template:{{{SYSTEM}}} stations]] (Template:LUL stations)
This template carries a translation table for the formatting/linking of the line. The template receives two parameters from S-line, {{{station}}} and {{{line}}}, although use of the latter is not often necessary. Station will be either the PREVIOUS or NEXT parameter; both are handled the same way behind the scenes. The easiest way to start the station template is with the default case that reflects how articles on system stations are named. With the London Underground, it's done this way:
| [[{{{station}}} tube station|{{{station}}}]]
Therefore, "Bayswater" produces [[Bayswater tube station|Bayswater]], all linked and ready to go.
Color
change[[Template:{{{SYSTEM}}} color]] (Template:LUL color)
This template is designed the same way as the others except that a default case is rare--lines within a system tend to have a different color. Note that some systems don't have a switch statement, because only one color is used. Such a template would consists only of a hex code. The pound sign is included within s-line so it isn't necessary to add it. This template forces the use of hex codes; no nouns are permitted (e.g. red, white). The template takes one parameter, {{{1}}}.
{{#switch:{{lc:{{{1}}}}} | bakerloo | bak = a45a2a | central | cen = da291c | circle | cir = ffcd00 | chelsea-hackney | c-h = 8cc63e | crossrail | cr = {{LCR color}} | crossrail2 | cr2 = e1eb5b | district | dis = 007a33 | east london | ell = ffa300 | fleet = 414b56 | hammersmith & city | h&c = e89cae | jubilee | jub = 7c878e | metropolitan | met = 840b55 | northern | nor = 000000 | piccadilly | pic | #default = 10069f | victoria | vic = 00a3e0 | waterloo & city | w&c = 6eceb2 | docklands light railway | docklands | dlr = {{DLR color}} | emirates air line | emirates | eal = c8102e | london overground | overground | log = {{LOG color}} | river | riv = 00a3e0 | tramlink | tl = {{#switch:{{{2}}} | 1 = {{tramlink color|1}} | 2 = {{tramlink color|2}} | 3 = {{tramlink color|3}} | 4 = {{tramlink color|4}} | #default = {{tramlink color}} }} | tl1 = {{tramlink color|1}} | tl2 = {{tramlink color|2}} | tl3 = {{tramlink color|3}} | tl4 = {{tramlink color|4}} | thameslink = 5c2483 }}
Termini
changeThese are the all-important templates which produce the "towards..." part of the templates. They can also get pretty tricky depending on the setup. The Victoria line is an easy example. It runs end-to-end from Brixton to Walthamstow Central. Therefore, the "left" (southbound) template contains "Brixton" while the "right" (northbound) template contains "Walthamstow Central". These names are plugged in to the STATION template just as NEXT and PREVIOUS were, with the results that you can see above. A feature of S-line is that if it detects that the next station is the name as the terminus, it will display a note to that effect instead of the destination. Hence,
{{s-start}} {{s-rail|title=LUL}} {{s-line|system=LUL|line=Victoria|previous=Brixton|next=Vauxhall}} {{s-end}}
Produces the box:
Preceding station | London Underground | Following station | ||
---|---|---|---|---|
Terminus | Victoria line | towards Walthamstow Central |
Now, let's say we've got a more complicated example, like the London Underground's Northern line, which runs from Morden north to one of three destinations: Edgware, Mill Hill East, or High Barnet. The Northern line's "left" template is still a simple line of text – Morden – but the "right" template needs a switch statement. The left and right templates receive one parameter, {{{type}}}, from s-line, which tells them which termini to return. Here's a simplified version of the Northern line's "right" template: {{#switch:{{{type}}} | Edgware=Edgware | High Barnet=High Barnet | Mill Hill East=Mill Hill East | Three=Edgware, Mill Hill East or High Barnet | Two=Mill Hill East or High Barnet | Kennington=Kennington }} This allows any combination of northbound destinations; depending on which branch the station is on. A default statement is acceptable here if it is true for disproportionate length of the line. In order to make this work properly, you have to define the concepts of "Edgware, Mill Hill East or High Barnet" and "Mill Hill East or High Barnet" in the STATION template, like so:
| Mill Hill East or High Barnet=[[Mill Hill East tube station|Mill Hill East]] or [[High Barnet tube station|High Barnet]]
Here's a hypothetical example of this at work:
{{s-start}} {{s-rail|title=LUL}} {{s-line|system=LUL|line=Northern|previous=Clapham North|next=Oval|type=Morden|type2=Three}} {{s-end}}
Produces the box:
Preceding station | London Underground | Following station | ||
---|---|---|---|---|
towards Morden | Northern line |
One-way operation
changeFor rail lines that operate in only one direction (such as going around a loop), the oneway1 or oneway2 parameters are used, to indicate that the Previous or Next station, respectively, does not have service going towards it. When these parameters are present with any non-null value, the toward [Terminal] line is replaced with One-way operation. For example, for a CTA station in the Chicago Loop:
{{s-rail-start}} {{s-rail|title=CTA}} {{s-text|text=[[Loop Elevated]]}} {{s-line|system=CTA|line=Orange|previous=Clark/Lake|next=Washington/Wabash|oneway1=true|type2=Midway}} {{s-line|system=CTA|line=Green|previous=Clark/Lake|next=Washington/Wabash|type2=Both}} {{s-line|system=CTA|line=Purple|previous=Clark/Lake|next=Washington/Wabash|oneway1=true|type2=Linden|rows1=2|notemid=Express}} {{s-line|system=CTA|line=Pink|previous=Clark/Lake|next=Washington/Wabash|type2=54|hide1=true}} {{s-line|system=CTA|line=Brown|previous=Clark/Lake|next=Washington/Wabash|type1=CCW|type2=CCW|oneway2=true}} {{s-end}}
Produces the box:
Preceding station | CTA | Following station | ||
---|---|---|---|---|
Loop Elevated | ||||
One-way operation | Orange Line | toward Midway |
||
toward Harlem/Lake | Green Line | toward Ashland/63rd or Cottage Grove |
||
One-way operation | Purple Line Express | toward Linden |
||
Pink Line | toward 54th/Cermak |
|||
toward Kimball | Brown Line | One-way operation |
Circular operation
changeParameters circular (both sides), circular1 (left cell only) and circular2 (right cell only) are useful for lines that operate in uninterrupted circular manner. These parameters simply hide the word "toward(s)" and then you need to edit the succession templates of that circular line to describe the direction and position of either side. The following example uses circular1 and circular2 with the terms "Clockwise" and "Counterclockwise":
{{s-rail-start}} {{s-rail|title=Walt Disney World Monorail}} {{s-line|system=WDW Monorail|line=Resort|previous=c|next=p|notemid='''Magic Kingdom'''<br>continuous loop clockwise|oneway1=yes|circular2=yes}} {{s-line|system=WDW Monorail|line=Express|previous=m|next=m|notemid='''Magic Kingdom'''<br>continuous loop counterclockwise|oneway2=yes|circular1=yes}} {{s-line|system=WDW Monorail|line=Epcot|next=e}} {{s-end}}
Produces the box:
Preceding station | Walt Disney World Monorail | Following station | ||
---|---|---|---|---|
One-way operation | Resort Line Magic Kingdom continuous loop clockwise | Next clockwise |
||
Next counterclockwise | Express Line Magic Kingdom continuous loop counterclockwise | One-way operation |
||
Terminus | Epcot Line | Terminus |
Alternatively, the following example uses circular, and the north american english term "counterclockwise" is interchanged with the commonwealth english term "anticlockwise".
{{s-rail-start}} {{s-rail|title=MOSMETRO}} {{s-line|system=MOSMETRO|line=Koltsevaya|previous=Krasnopresnenskaya|next=Novoslobodskaya|circular=yes}} {{s-end}}
Produces the box:
Preceding station | Moscow Metro | Following station | ||
---|---|---|---|---|
anticlockwise / outer | Koltsevaya line | clockwise / inner |
Through operation
changeWhen there are different rail services connected on the same line, the through1 or through2 parameters are used to differentiate said services. When these parameters are present with any non-null value, the toward [Terminal] line is replaced with through to [Adjacent line]. This incorporates the use of previous and next, with the use of an adjacent line instead of an adjacent station. These parameters are not commonly used, but an example from Jamaica station:
{{s-rail-start}} {{s-rail|title=LIRR}} {{s-line|system=LIRR|line=City|previous=Kew Gardens|next=Branches|type=Penn Station|rows2=3|rowsmid=3|through2=yes}} {{s-line|system=LIRR|line=City|previous=Hunterspoint Avenue|next=Branches|type=Long Island City|hide2=yes|hidemid=yes}} {{s-line|system=LIRR|line=City|previous=East New York|type=Atlantic Terminal|hide2=yes|hidemid=yes}} {{s-line|system=LIRR|line=Belmont Park|next=Belmont Park|rows1=12|previous=City|through1=yes}} {{s-line|system=LIRR|line=Hempstead|next=Hollis|hide1=yes}} {{s-line|system=LIRR|line=Port Jefferson|next=New Hyde Park|hide1=yes}} {{s-line|system=LIRR|line=Oyster Bay|next=Mineola|hide1=yes}} {{s-line|system=LIRR|line=Ronkonkoma|next=Mineola|hide1=yes}} {{s-line|system=LIRR|line=Montauk|next=Mineola|hide1=yes|rowsmid=2}} {{s-line|system=LIRR|line=Montauk|next=Babylon|hide1=yes|hidemid=yes}} {{s-line|system=LIRR|line=West Hempstead|next=St. Albans|hide1=yes|rowsmid=2}} {{s-line|system=LIRR|line=West Hempstead|next=Valley Stream|hide1=yes|hidemid=yes}} {{s-line|system=LIRR|line=Babylon|next=St. Albans|hide1=yes}} {{s-line|system=LIRR|line=Far Rockaway|next=Locust Manor|hide1=yes}} {{s-line|system=LIRR|line=Long Beach|next=Locust Manor|hide1=yes}} {{s-end}}
Produces the box:
Preceding station | LIRR | Following station | ||
---|---|---|---|---|
toward Penn Station | City Terminal Zone | through to Branches |
||
toward Long Island City |
||||
toward Atlantic Terminal |
||||
through to City Terminal Zone | Belmont Park Branch | Terminus |
||
Hempstead Branch | toward Hempstead |
|||
Port Jefferson Branch | toward Port Jefferson |
|||
Oyster Bay Branch | toward Oyster Bay |
|||
Ronkonkoma Branch | toward Greenport |
|||
Montauk Branch | toward Montauk |
|||
toward Montauk |
||||
West Hempstead Branch | toward West Hempstead |
|||
toward West Hempstead |
||||
Babylon Branch | toward Babylon |
|||
Far Rockaway Branch | toward Far Rockaway |
|||
Long Beach Branch | toward Long Beach |
Parallel lines
changeFor lines that operate on the same tracks and serve the same next station and final terminal, the rows1, rows2, hide1, and hide2 optional parameters can be used to have the Previous (the 1s) or Next (the 2s) Station boxes cover more than one line. The rows parameters specify how many lines the station should cover, while the hide parameters ensure that the table formatting remains intact. The two parameters must be used together, with hide specified for every line that is being covered by the first line. An example of this use can be seen in the preceding CTA box. Note that, in the preceding CTA example, the previous and oneway1 parameters could have been omitted from the Purple and Pink line entries, but were left in for consistency's sake.
Another example of this:
{{S-start}} {{S-rail|title=LUL}} {{S-line|system=LUL|line=Circle|previous=Westbourne Park|next=Paddington|type2=Aldgate|rows1=2}} {{S-line|system=LUL|line=Hammersmith & City|previous=Westbourne Park|next=Paddington|hide1=yes}} {{S-end}}
Produces the box:
Preceding station | London Underground | Following station | ||
---|---|---|---|---|
towards Hammersmith | Circle line | towards Edgware Road (via Aldgate) |
||
Hammersmith & City line | towards Barking |
Transfers
changeThe transfer
parameter makes it possible to show within the box lines available at a different station with which there's a direct transfer from the current station. This snippet is taken from the article about the Finchley Road tube station. The North London Line does not actually serve the station itself, but there's an official out of system transfer designated between London Underground services at Finchley Road and London Overground services at the nearby Finchley Road & Frognal station:
{{s-start}} {{s-rail|title=LUL}} {{s-line|system=LUL|line=Jubilee|previous=West Hampstead|next=Swiss Cottage|type2=one}} {{s-line|system=LUL|line=Metropolitan|previous=Wembley Park|next=Baker Street|type=Four|rowsmid=2|rows2=2}} {{s-line|system=LUL|line=Metropolitan|previous=Harrow-on-the-Hill|next=Finchley Road|type=Four|hidemid=yes|hide2=yes|note=Peak periods only}} {{s-note|text=Out-of-system interchange}} {{s-rail|title=LOG}} {{s-line|system=LOG|line=North London|previous=West Hampstead|next=Hampstead Heath|transfer=Finchley Road & Frognal}} {{s-end}}
Produces the box:
Preceding station | London Underground | Following station | ||
---|---|---|---|---|
towards Stanmore | Jubilee line | towards Stratford |
||
Metropolitan line | towards Baker Street or Aldgate |
|||
Peak periods only |
||||
Out-of-system interchange | ||||
Preceding station | London Overground | Following station | ||
towards Richmond or Clapham Junction | North London Line Transfer at: Finchley Road & Frognal | towards Stratford |
Branches
changeThe branch
parameter can be used to describe a subset of a line
. In the example hereafter, the branch
parameter designates four different parts of the MBTA's Green Line. When passed to the left and right termini templates, the branch
and line
parameters identify destinations. Additionally, the branch name is displayed beneath the line name.
Optionally, [[Template:{{{SYSTEM}}} lines/branches]] may be defined, which allows the linking of the branch parameter.
In this example hereafter, taken from the Acton Town tube station article, the branch template (Template:LUL lines/branches) is defined, allowing branch linking. Additionally, through the branch
parameter, the left and right hand termini are generated. In some cases, a type
parameter can be used to supplement the branch
parameter. If necessary, a notemid=
parameter can be used to substitute for a branch
parameter.
{{s-start}} {{s-rail|title=LUL}} {{s-line|system=LUL|line=District|previous=Ealing Common|next=Chiswick Park|type=Ealing Broadway|type2=One}} {{s-line|system=LUL|line=Piccadilly|type=Uxbridge|notemid=[[Piccadilly line#Uxbridge branch|Uxbridge branch]]|previous=Ealing Common|next=Turnham Green|note2=Early morning and late evening service only|rowsmid=2|rows1=2}} {{s-line|system=LUL|line=Piccadilly|branch=Uxbridge|previous=Ealing Common|next=Hammersmith|hidemid=yes|hide1=yes}} {{s-line|system=LUL|line=Piccadilly|branch=Heathrow|previous=South Ealing|next=Turnham Green|note2=Early morning and late evening service only|rowsmid=2|rows1=2}} {{s-line|system=LUL|line=Piccadilly|branch=Heathrow|previous=South Ealing|next=Hammersmith|hidemid=yes|hide1=yes}} {{s-end}}
Produces the box:
Preceding station | London Underground | Following station | ||
---|---|---|---|---|
towards Ealing Broadway | District line | towards Upminster or High Street Kensington |
||
towards Rayners Lane or Uxbridge | Piccadilly line | Early morning and late evening service only towards Cockfosters |
||
towards Cockfosters |
||||
Piccadilly line | Early morning and late evening service only towards Cockfosters |
|||
towards Cockfosters |
Styles
change[[Template:{{{SYSTEM}}} style]] (Template:Amtrak style)
The style template allows the modification, at a system level, of display parameters for inter-related templates, including Template:Infobox Station.
Parameter | Description | Notes |
---|---|---|
lang | Which version of English to output display in. Specify GB for British; the default is US. If GB is specified, the boxes will say "towards" (station). If US is specified, the boxes will say "toward" (station). | Optional; S-line only |
name_format | Formatting for the {{{name}}} parameter itself |
Optional; Infobox Station only |
showterm | A "No" value suppresses the display of termini information | Optional; S-line only |
stop_noun | Type of stop (e.g. station, tram stop); default is "station" | Optional; S-rail only |
thcolor | Font color for table headings | Optional; Infobox Station only |
thbgcolor | Background color for table headings | Optional; Infobox Station only |
title_nowrap | If "yes", will apply the nowrap style to s-rail headings. Not recommended for use within Infobox Station | Optional; S-rail only |
TemplateData
changeTemplateData for S-line
S-line is a specialised succession box template that links railway station articles
Parameter | Description | Type | Status | |
---|---|---|---|---|
system | system | The system to which the line belongs | String | required |
line | line | The name of the line | String | required |
previous | previous | The name of the previous station, should correspond to a specific template name | String | optional |
next | next | The name of the next station, should correspond to a specific template name | String | optional |
type | type | The left-hand line branch | String | optional |
type2 | type2 | The right-hand line branch | String | optional |
note | note | Information about the left-hand line branch | String | optional |
notemid | notemid | Information about the station itself | String | optional |
note2 | note2 | Information about the right-hand line branch | String | optional |
oneway1 | oneway1 | Indicates that trains do not operate towards the Previous station | String | optional |
oneway2 | oneway2 | Indicates that trains do not operate towards the Next station | String | optional |
through1 | through1 | Allows, instead of a previous station, service passing to another line on the system. | String | optional |
through2 | through2 | Allows, instead of a next station, service passing to another line on the system. | String | optional |
state1 | state1 | Allows the passing of an additional station parameter. Useful for disambiguation. | String | optional |
state2 | state2 | Allows the passing of an additional station parameter. Useful for disambiguation. | String | optional |
branch | branch | Can be used to describe a subset of a line. | String | optional |
transfer | transfer | Used to show lines available by direct transfer at an adjoining station. | String | optional |
round1 | round1 | If set displays 'Reverses direction' in left cell | String | optional |
round2 | round2 | If set displays 'Reverses direction' in right cell | String | optional |
circular | circular | If set hides 'toward' of both sides | String | optional |
circular1 | circular1 | If set hides 'toward' of left cell only | String | optional |
circular2 | circular2 | If set hides 'toward' of right cell only | String | optional |
rows1 | rows1 | Number of rows for left hand column | String | optional |
rowsmid | rowsmid | Number of rows for center hand column | String | optional |
rows2 | rows2 | Number of rows for right hand column | String | optional |
hide1 | hide1 | Hides the previous station, used when a previous row has 'rows1' set | String | optional |
hidemid | hidemid | Hides this station, used when a previous row has 'rowsmid' set | String | optional |
hide2 | hide2 | Hides the next station, used when a previous row has 'rows2' set | String | optional |