Template talk:S-line

From Wikipedia, the free encyclopedia

This article is within the scope of WikiProject Trains, an attempt to build a comprehensive and detailed guide to rail transport on Wikipedia. If you would like to participate, you can visit the project page, where you can join the project and/or contribute to the discussion.
See also: WikiProject Trains to do list
Template This page is a template and does not require a rating on the quality scale. (assessment comments)

Contents

[edit] Documentation

S-line must be encased within {{s-start}} and {{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
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

[edit] Making it work

S-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 Kalamazoo Transportation Center:

Previous station   Amtrak   Next station
toward Chicago
  Wolverine  
toward Pontiac

First of all, here's the underlying code:

{{s-start}}
{{s-rail|title=Amtrak}}
{{s-line|system=Amtrak|line=Wolverine|previous=Dowagiac|next=Battle Creek}}
{{end}}

Template:S-start is the generic template used to begin thousands of succession boxes. 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 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 Amtrak.
  • LINE: The line name. This is also case-sensitive and must be consistent throughout. Here, we're describing the Wolverine.
  • 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, a 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 colour, and the display of the appropriate termini–all automatic.

[edit] Line

[[Template:{{{SYSTEM}}} lines]] (Template:Amtrak 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. The relevant line from Template:Amtrak lines is this:

| Wolverine=''[[Wolverine (passenger train)|Wolverine]]''

This links to the article on the Wolverine and italicizes the article, appropriate for a named train. This means if the article ever moves, you need only to update switch statement, not individual articles. 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}}}
 | DLR
 | Docklands Light Railway=[[Docklands Light Railway]]
 | #default=[[{{{1}}} Line]]
}}

[edit] Station

[[Template:{{{SYSTEM}}} stations]] (Template:Amtrak 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 Amtrak, it's done this way:

 | #default=[[{{{station}}} (Amtrak station)|{{{station}}}]]

Therefore, "Dowagiac" produces [[Dowagiac (Amtrak station)|Dowagiac]], all linked and ready to go.

[edit] Colour

[[Template:{{{SYSTEM}}} color]] (Template:Amtrak color)

Note that colour is spelled the American way in the template; the creator apologizes in advance and it's probably not worth the hassle to change it at this stage. 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 colour. Amtrak is an important exception, and doesn't even have a switch statement: the template consists only of the hex code: 004670. The pound sign is included within s-line so it isn't necessary. This also forces the use of hex codes; no nouns are permitted (e.g. red, white). The template takes one parameter, {{{1}}}. A good example is found here at Template:SEPTA color:

{{#switch:{{{1}}}
 | Market-Frankford=0081C4
 | Route 10=5D9842
 | Route 11=5D9842
 | Route 13=5D9842
 | Route 34=5D9842
 | Route 36=5D9842
 | Route 100=993F96
 | Route 101
 | Route 102=AF5F18
 | R1=F9EF02
 | R2=A80058
 | R3=F9812A
 | R5=0255A1
 | R6=049471
 | R7=E63641
 | R8=CF731E
 | Broad-Ridge
 | Broad Street=F58735
}}

[edit] Termini

[[:Template:S-line/{{{SYSTEM}}} left/{{{LINE}}}]] (Template:S-line/Amtrak left/Wolverine)
[[:Template:S-line/{{{SYSTEM}}} right/{{{LINE}}}]] (Template:S-line/Amtrak right/Wolverine)

These are the all-important templates which produce the "towards..." part of the templates. They can also get pretty tricky depending on the setup. The Wolverine is an easy example. It runs end-to-end from Chicago, Illinois to Pontiac, Michigan. Therefore, the "left" (westbound) template contains "Chicago" while the "right" (eastbound) template contains "Pontiac". 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=Amtrak}}
{{s-line|system=Amtrak|line=Wolverine|previous=Chicago|next=Battle Creek}}
{{end}}

produces:

Previous station Amtrak Next station
Terminus
Wolverine
toward Pontiac

Now, let's say we've got a more complicated example, like the Lake Shore Limited, which runs from Chicago east to either Boston or New York. The Limited's "left" template is still a simple line of text–Chicago–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 the Limited's "right" template: {{#switch:{{{type}}} |Both=New York or Boston South |New York=New York |Boston=Boston South }} This allows three eastbound destinations: New York, Boston, or both if the train hasn't reached the junction point yet. 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 concept of "New York or Boston South" in the STATION template, like so:

 | New York or Boston South=[[Pennsylvania Station (New York City)|New York]] or [[Boston South (Amtrak station)|Boston South]]

Here's a hypothetical example of this at work:

{{s-start}}
{{s-rail|title=Amtrak}}
{{s-line|system=Amtrak|line=Lake Shore Limited|previous=Chicago|next=Battle Creek|type2=Both}}
{{end}}
Previous station Amtrak Next station
Terminus
Lake Shore Limited

[edit] One Way Operation

For 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-start}}
{{s-rail|title=CTA}}
{{s-line|system=CTA|line=Brown|previous=Clark/Lake|next=Randolph/Wabash|type=Kimball|oneway2=true}}
{{s-line|system=CTA|line=Green|previous=Clark/Lake|next=Randolph/Wabash|type2=Both}}
{{s-line|system=CTA|line=Orange|previous=Clark/Lake|next=Randolph/Wabash|oneway1=true|type2=Midway|rows1=3}}
{{s-line|system=CTA|line=Purple|previous=Clark/Lake|next=Randolph/Wabash|oneway1=true|type2=Linden|hide1=true}}
{{s-line|system=CTA|line=Pink|previous=Clark/Lake|next=Randolph/Wabash|oneway1=true|type2=54|hide1=true}}
{{end}}

Produces the box:

Previous station Chicago 'L' Next station
toward Kimball
Brown Line
One-way operation
Green Line
One-way operation
Orange Line
toward Midway
Purple Line
toward Linden
Pink Line
toward 54/Cermak

[edit] Parallel Lines

For 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 then 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 above CTA box. Note that, in the above 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.

[edit] Discussion

[edit] Documentation?

So how do we use this template? I've tried converting the explicit code in San Bernardino (Amtrak station) to correctly show the Metrolink successions, but haven't been entirely successful yet. Slambo (Speak) 21:16, 24 January 2007 (UTC)

Regrettably documentation is largely stuck in my head at the moment and on assorted talk pages. I've been working on unified documentation but it isn't finished. In the meantime, I'd be happy to answer questions. Mackensen (talk) 21:22, 24 January 2007 (UTC)

I've taken a further stab at explaining this beast. Mackensen (talk) 03:07, 6 February 2007 (UTC)

Way cool. Thanks for the doc. Slambo (Speak) 11:20, 6 February 2007 (UTC)

I've added documentation for the one-way functionality I added a bit ago, as well as some other optional parameters I found useful when doing the CTA succession boxes. Which, now that my work has calmed down a bit, I really need to get back to converting. -- Loco830/Espio (Rant) 06:43, 8 February 2007 (UTC)

[edit] DLR

The Doklands Light Railway is not actually part of the London Underground but there are many thins integrated and i suppose, reluctantly, it is for the ease of the traveller.

[edit] Circle Line

For the London Underground Circle Line you're using toward Inner Circle, which makes no sense. At the signs at stations the destination is shown as "via Liverpool Street" (or whatever well-known station is about a third of the way round in the direction of the train). Could the template (and the stations) be updated to use the same scheme? --88.109.224.119 12:14, 11 February 2007 (UTC)

  • Yes they could, but we'd need to work out a scheme beforehand. Mackensen (talk) 15:12, 11 February 2007 (UTC)

Dividing the circle into 4 sections, something like this should work:

  • Aldgate to Temple - toward Victoria / toward Liverpool Street
  • Embankment to Bayswater - toward Paddington / toward Tower Hill
  • Notting Hill Gate to Baker Street - toward Liverpool Street / toward High Street Kensington
  • Great Portland Street to Aldgate - toward Tower Hill / toward Baker Street

I think the platform indicators actually use more overalapping sections than this, which would be quite complex to emulate. MRSCTalk 20:57, 11 February 2007 (UTC)

Well, let's break down how the Circle Line interacts with the rest of the system. The clock-wise trains are on the right-hand side from High Street Kensington to Aldgate, then left-hand from Tower Hill to Gloucester Road. It might make sense to designate the four "sections" geographically: SW, NW, NE, SE. We could go even further and define NC (North Central) and SC (South Central). Mackensen (talk) 22:19, 11 February 2007 (UTC)

Direction Location Temini
NW High Street Kensington to Edgware Road Victoria / King's Cross St. Pancras
NC Baker Street to King's Cross St. Pancras High Street Kensington / Liverpool Street
NE Farringdon to Aldgate Paddington / Tower Hill
SE Tower Hill to Blackfriars King's Cross St. Pancras / Victoria
SC Temple to Westminster Liverpool Street / High Street Kensington
SW St. James's Park to Gloucester Road Tower Hill / Paddington

Now, both type and type2 should be set to the section of the line that the station is located in. Everything else will show up automatically.Mackensen (talk) 22:34, 11 February 2007 (UTC)

These boundaries can be modified very easily, by the way. Mackensen (talk) 22:38, 11 February 2007 (UTC)

[edit] LUL District line termini

The termini need to be updated as they currently point to redirects.

Thanks. MRSCTalk 20:32, 11 February 2007 (UTC)

Also, Wimbledon tube station is a link from the box used at Earl's Court tube station. This points to a dab page. It is not transparent how to update these. MRSCTalk 18:05, 13 February 2007 (UTC)
This is done at the "stations" template, in this case Template:LUL stations. The following line takes care of the problem:
Wimbledon=[[Wimbledon station|Wimbledon]]
Mackensen (talk) 18:15, 13 February 2007 (UTC)
Much obliged. MRSCTalk 19:07, 13 February 2007 (UTC)

[edit] South Eastern

Right i fancy having a go at implementing some of this across "my patch". I'm confused about what data i have to put in where. I understand the conversion of rail line to s-rail, etc. ie do i put in a list of stations, a list of lines by the TOC, etc? Pickle 20:28, 22 March 2007 (UTC)

  • Well, it depends on several factors. Some TOCs already have their data backend defined; some don't. The first thing you have to establish is the "system name" each TOC will use within the s-rail/s-line system. In the states this is often, but not always, the AAR reporting mark. In the United Kingdom, the full name of the TOC (e.g. c2c, First ScotRail) is used instead. Each TOC then needs its own sub-templates, as defined above:
  1. Line
  2. Station
  3. Color

Now, the question of "line" may vary according to your local rail culture. "Line" in this sense really means service, as services may run over one or more historic "lines" and said "lines" are no longer owned by the original company. With Amtrak, for example, there's a separate definition for each named train. Each line/service will need its own termini definition. A common rule of the road is that west is on the left, east on the right, and everything above all should be consistent. I'd be happy to field questions about individual TOCs, but those are the basics. Best, Mackensen (talk) 21:27, 22 March 2007 (UTC)

Thanks for the reply (I'll get on with this next week hopefully)
I appreciate the distinction between line and services you are making.
So i would need a list of "lines/services", a list of stations and a colour for the TOC. The last two are relatively easy, the first will be challenging as not all have the "mapped out" for want of a better phrase.
A supplementary question would be how do i handle closed/truncated "lines/services" eg Dover Priory railway station, Strood railway station, etc
Pickle 16:40, 23 March 2007 (UTC)
Well, a couple options for disused lines. One, you can just ignore them altogether. S-rail/s-line and rail line can co-exist peaceably within the same table. Another is to simply define them as you would any other system. A third option is to not show disused systems altogether (which is what has happened in the states). Mackensen (talk) 17:24, 23 March 2007 (UTC)
OK I've tested it on a much smaller TOC, the VSOE, which only has two stations London Victoria station and Folkestone Harbour railway station. I followed the documentation above (is Amtrack the best example) and looked at C2C as well. If I've done it right I've made the following 5 templates;
  • Template:S-line/VSOE right/VSOE
  • Template:S-line/VSOE left/VSOE
  • Template:VSOE color
  • Template:VSOE lines
  • Template:VSOE stations
it was confusing because the example don't show a simple one line one TOC system and left me confused (as Amtrack and LUL are examples of complexity).
If all thats is right, the bit that has so far confused me is adding more lines/services, i take it i add more lines/services to the "Template:TOC lines" and then create "Template:S-line/TOC right/line" and "Template:S-line/TOC left/line" (as the colour doesn't change).
The "Template:TOC stations" to solve redirect problems eg [[London Victoria railway station]] instead of [[London Victoria station]] wasn't immediately apparent
thanks for your patients! Pickle 14:47, 27 March 2007 (UTC)

Yes, that's the way to do a one-line system. You've also got it right for adding more lines/services. Looks great! Mackensen (talk) 14:52, 27 March 2007 (UTC)

I've made one minor change [1]. It's common practice in the UK articles for intermodal stations to be named X station instead of X railway station. If you generalize the template, you can simply list stations that meet the exception. Mackensen (talk) 14:55, 27 March 2007 (UTC)

ahh thanks, i've done the Gatwick Express as well and that was much quicker now i know what i'm doing! The next step is to try a bigger system. Pickle 16:19, 27 March 2007 (UTC)
having a look at Gatwick Airport railway station, and i had a go at the Virgin routes through the station but it doesn't want to work (properly), a deeper examination showed that the Virgin cross country stuff is very complex!!! What am i doing wrong? Pickle 16:49, 27 March 2007 (UTC)
Virgin Cross-Country was beyond vexing during development. You'll need to examine Template:S-line/Virgin Trains right/VT2 (which holds the definitions for both directions) to see what directions you need. You'll then need to plug those into type and type2. Mackensen (talk) 18:11, 27 March 2007 (UTC)
Thanks, very complex ;) Pickle 18:27, 27 March 2007 (UTC)