This is an archive of past discussions about Template:S-line. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page.
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.
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 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)
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.11912:14, 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. MRSC • Talk20: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)
I think that a "free transfer" parameter should be added in addition to a "transfer" parameter to distinguish where free transfers exist, as opposed to transfers where one must pay an additional fare. If anyone else agrees, I'll add an {{editprotected}} template to this page and add one. –Crashintome419623:35, 13 May 2007 (UTC)
It looks perculiar when it appears on an article about a London tube station or an MTR station. Qaka19:48, 5 August 2007 (UTC)
Well, if it's a difference between American English and British English, it might be possible to re-write this template (and related templates) to reflect that difference. The trick is doing it the right way. Mackensen(talk)20:02, 5 August 2007 (UTC)
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? Pickle20: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:
Line
Station
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.
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
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. Pickle16: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? Pickle16:49, 27 March 2007 (UTC)
Err no. I'm sitting back waiting for the mushroom could to go up from a certain user.... Personally i like s-rail (see my work in new Zealand) but i don't like it cramped up in the station Infobox. I've warned Geoking66 about the prior lack of consensus on s-rail / keeping of "rail line", and Geoking66 "boldly" added to code to {{Infobox UK station}} to allow s-rail to be show, but without establishing a consensus first. again i fear i vast edit war... Pickle17:42, 30 August 2007 (UTC)
The station option was added for the WMATA and PATH folks, but it's definitely not suitable in all cases. Where at all possible s-line/s-rail should mimic the previous setup; adding information unobtrusively. I'd suggest moving that stuff out into the article to avoid unnecessary aggravation. Note that
{{s-rail-start}} takes the noclear=yes parameter which stops the page-clearing line break. Mackensen(talk)18:12, 30 August 2007 (UTC)
I've had a play with the defunct Epping to Ongar shuttle (on London Underground's Central Line), using "s-rail" rather than the traditional "rail line". Two issues spring to mind a) how does one get the "disused rail insert" bit to look right (use s-note ?) and b) how should an intermediate station like Blake Hall (that closed before the rest of the line) be handled (see North Weald and Epping). It also does look a bit funny when the heritage rail bit comes in as well (it doesn't look aligned right). No real panic, I'm just playing. Pickle09:41, 12 September 2007 (UTC)
I think I grappled with that a couple months back as well, with the same issues. S-note would be one possibility, but it would be nice to have a standard template. Let me think on it. Mackensen(talk)10:56, 12 September 2007 (UTC)
What are all the options in s-line?
I've been looking at the source code and there seems to be some stuff in there that has not been fully explained in the talk page, and how to use them. New users of this template could potentially miss out some of the functions of this template, and might even suggest new ones.
The trick is that sometimes branch is used to convey supplemental information, instead of further modifying route information. Now, it might be possible to modify the template so that branch auto-linking is opt-in. Mackensen(talk)10:51, 1 November 2007 (UTC)
Okay, here's Arlington re-worked with the new idea:
Basically, {{{branch}}}, {{{system}}}, and {{{line}}} are all passed to a new template: [[Template:{{{SYSTEM}}} lines/branches]] (Template:MBTA lines/branches). If that template doesn't exist, the branch is displayed normally. Otherwise, you've a full range of linking options. This is in the development version of the template; I can merge it into the main template any time. Mackensen(talk)12:23, 1 November 2007 (UTC)
Image:Mbta-logo.svg is being used on this article. I notice the image page specifies that the image is being used under fair use but there is no explanation or rationale as to why its use in this Wikipedia article constitutes fair use. In addition to the boilerplate fair use template, you must also write out on the image description page a specific explanation or rationale for why using this image in each article is consistent with fair use.
Please go to the image description page and edit it to include a fair use rationale. Using one of the templates at Wikipedia:Fair use rationale guideline is an easy way to insure that your image is in compliance with Wikipedia policy, but remember that you must complete the template. Do not simply insert a blank template on an image page.
If there is other fair use media, consider checking that you have specified the fair use rationale on the other images used on this page. Note that any fair use images uploaded after 4 May, 2006, and lacking such an explanation will be deleted one week after they have been uploaded, as described on criteria for speedy deletion. If you have any questions please ask them at the Media copyright questions page. Thank you.
Image:Mbta-logo.svg is being used on this article. I notice the image page specifies that the image is being used under fair use but there is no explanation or rationale as to why its use in this Wikipedia article constitutes fair use. In addition to the boilerplate fair use template, you must also write out on the image description page a specific explanation or rationale for why using this image in each article is consistent with fair use.
Please go to the image description page and edit it to include a fair use rationale. Using one of the templates at Wikipedia:Fair use rationale guideline is an easy way to insure that your image is in compliance with Wikipedia policy, but remember that you must complete the template. Do not simply insert a blank template on an image page.
If there is other fair use media, consider checking that you have specified the fair use rationale on the other images used on this page. Note that any fair use images uploaded after 4 May, 2006, and lacking such an explanation will be deleted one week after they have been uploaded, as described on criteria for speedy deletion. If you have any questions please ask them at the Media copyright questions page. Thank you.
i've created a new template s-rail-next that takes in the same parameters as s-rail, but without the "preceding/following station" column title. Main use is for multiple lines in succession box. the london overground title uses this in the following example:
Currently there is a s-line-jnct template, which has the effect of spanning lines into 2 rows, example is Westferry DLR station. I feel that it would be better to merge it into this template with the above 2 parameters, and it can be dealt with the same way as the current parameters rows1 & rows2 and hide1 & hide2. Furthermore, merging into this template would give the flexibility of spanning it to more than just 2 rows, as the current template does. Anyone with me on this? - oahiyeeltalk07:07, 21 November 2007 (UTC)
Not really. I don't quite remember why I created it in the first place. The only difference is that it spans the central cell (with the line information), which can be useful but not essential. S-line-jnct also predates the development of "branching," which helped eliminate the need. I would not be adverse to deprecating its usage. Mackensen(talk)16:53, 21 November 2007 (UTC)
I feel that the the spanning of the central cell is still useful and would not deprecate the usage of branching. Some rail lines do not have an "official" branch name, for example splitting of the line into the same loop in different direction. This difference in direction thus would be indicated by the "type" parameter. In this case, it would be useful to span the central cell. In the normal cases where the lines have specific branch names, the branch method should still be used. - oahiyeeltalk18:18, 21 November 2007 (UTC)
Yes, I see what you're getting at now. I'll put the two methods here for clarity.
s-line-jnct does deserve more mention in the discussion portion. I don't exactly know how to decipher the code, so I can't help there. 리지강.wa.au (의논하다|기여) 19:12, 21 November 2007 (UTC)
Yes that's exactly what i mean. I don't think it's necessary to decipher the s-line-jnct code. Basically, it should take the same method as rows1 etc. where the parameter after the = sign indicates the number of rows to span. - oahiyeeltalk19:23, 21 November 2007 (UTC)
S-line-jnct does, but it produces odd results sometimes. What might make sense is simply allowing central spanning within s-line. Let me play with that in my userspace. Mackensen(talk)20:52, 21 November 2007 (UTC)
As a matter of fact, yes ;) I've merged the new code and updated your second example above. S-line-jnct is now redundant and should probably be orphaned. Mackensen(talk)15:37, 23 November 2007 (UTC)
rows2 doesn't work if previous parameter is absent together with spanning rows1 and rowsmid
I think I saw this before with s-jnct, and tried to reproduce it in standard html, only to have the same problem. That is, if memory serves, this is a standard html rendering issue. Can you create the "correct" table using html or wikitax? Mackensen(talk)16:30, 24 November 2007 (UTC)
Yes, i understand what u mean now, I think it's a rendering issue. Probably because every row is spanned, rendering the "extra" row in between useless. The only way to make it render with the desired effect is for at least one of the rows to have more than 1 line of text, or creating an "invisible column" that would not be spanned.
Note that using rowspan="2" for cell G combined with rowspan="3" for cell F to get another row below G and F won't work, because all (implicit) cells would be empty. Likewise complete columns are not displayed if all their cells are empty. Borders between non-empty and empty cells might be also not displayed (depending on the browser), use to fill an empty cell with dummy content.
Nothing by default. They're passed to the station templates, mainly for purposes of disambiguation. However, the system station templates have to be told to look for them, and to do something with them. I implemented this is response to the new developer-imposed limit on {{#ifexist}} calls, because {{GSR stations}} was breaking on some articles. Mackensen(talk)11:50, 6 December 2007 (UTC)
Fair use rationale for Image:NS logo.jpg
Image:NS logo.jpg is being used on this article. I notice the image page specifies that the image is being used under fair use but there is no explanation or rationale as to why its use in this Wikipedia article constitutes fair use. In addition to the boilerplate fair use template, you must also write out on the image description page a specific explanation or rationale for why using this image in each article is consistent with fair use.
Please go to the image description page and edit it to include a fair use rationale. Using one of the templates at Wikipedia:Fair use rationale guideline is an easy way to insure that your image is in compliance with Wikipedia policy, but remember that you must complete the template. Do not simply insert a blank template on an image page.
If there is other fair use media, consider checking that you have specified the fair use rationale on the other images used on this page. Note that any fair use images lacking such an explanation can be deleted one week after being tagged, as described on criteria for speedy deletion. If you have any questions please ask them at the Media copyright questions page. Thank you.
Nice sarcasm... and yet you never got a response.... is there evidence that this template leads to vandalism by established users? ~ PaulC/T+09:05, 8 January 2008 (UTC)
I didn't think he wanted a response, frankly. Given that it's been fully protected since it became high-use, no, there's no history of vandalism. Mackensen(talk)12:28, 8 January 2008 (UTC)
It's not a bug (not within the template, anyway); it's an unused feature. When ifexist checks for its existence it winds up getting transcluded even though it doesn't exist. Chalk that one up to the oddities of mediawiki I suppose. If it's bothering you, there's a generic placeholder that could go there. Mackensen(talk)12:30, 8 January 2008 (UTC)
Documentation
{{editprotect}}
I've created the subpage Template:S-line/doc so that the it can be included on the main page instead of the talk space. Could someone edit the page and put in {{subst:#ifexist:{{subst:#invoke:string|replace|{{subst:FULLPAGENAME}}|/sandbox$|plain=false}}/doc|{{{{subst:void}}documentation}}}}? Thanks :) - oahiyeeltalk04:02, 11 June 2008 (UTC)
I have recently seen templates converted to S-rail but associated Heritage and / or Historical boxes left as they are (see Grosmont railway station) - the result is to convert a single tidy composite box into a pair of ugly mismatched boxes (because the two template types do not join up or assume common widths).
From what I have read about S-rail, I imagine it should be able to handle all three types (UK national, heritage and historical (closed) lines), although I do not understand it well enough myself to try it.
May I ask that those who are changing existing templates to S-rail should do a complete job when they encounter junctions with historical or heritage lines, so as not to leave a visual mess in their wake.
For MTRLight Rail lines 705 and 706 (Tin Shui Wai Circular), there are no terminuses for both lines. The trains keep running in Tin Shui Wai in clockwise or anti-clockwise direction. And the trains only show the words "705 Tin Shui Wai Circular" or "706 Tin Shui Wai Circular" instead of any destinations. (Please refer to this photo.)
At this moment, this template shows "towards Tin Shui Wai Circular
(counter-clockwise)" or "towards Tin Shui Wai Circular
(clockwise)" for the above situation. But I think they are not the appropriate descriptions. So I would like to ask how to hide the word "towards".
Over the past week or so I moved all s-rail and s-line related templates from LYNX to CATS as the latter is the main provider and operator of LYNX and Charlotte Trolley. I'm having trouble with trying to make the Trolley-related articles which are separate from the LYNX station articles work with the links. I don't know how this works for the Miami-Dade Transit rail station articles for the Metrorail and Metromover stations, so any help would be appreciated. GETONERD84 (talk) 01:20, 19 February 2010 (UTC)
Working with {{s-line}} can be very confusing, and it took me a while to understand it at first too. I fixed those stations by editing {{CATS stations}}. Take a look at the code to see how its done. I also shortened "Charlotte Area Transit System" to simply "CATS" in the {{s-rail}} boxes. –Dream out loud (talk) 02:15, 20 February 2010 (UTC)
Not reverting to bottom
Is there any way that we can make the box not automatically go down to the bottom of the page? This occurs when an infobox ends up being longer than the text of an article. Geoking66talk20:52, 23 March 2010 (UTC)
Possibly; the greater issue is introducing the notion of two colors to "X Color" templates out there without breaking compatibility. I don't think it would be a quick change. Mackensen(talk)22:16, 19 April 2010 (UTC)
/Tranz Metro/Paraparaumu Line
Hello... could someone with editing rights please change Tranz Metro/Paraparaumu Line to Kapiti Line? Since the template is locked I'm unable to. --LJ Holden 21:30, 27 February 2011 (UTC)
How can I put a piped link in the |line= field? I was editing a page that uses Template:S-rail-national, which in turn uses Template:S-line. The page in question is York railway station, which linked to a disambuigation page instead of Grand Central Railway. With Template:S-rail-national I couldn't make the link point to the correct page without changing the text of the page. As a temporary solution, I've replaced Template:S-rail-national with Template:Rail line. (With Template:S-rail-national, the renamed |line= field is a link, so the link text is the name of the target article, but with Template:Rail line the eqivalent field has to be explicitly linked, so it can contain a piped link.) Tim Ivorson 2011-05-21 14:35, 21 May 2011 (UTC)
Has there been any discussion anywhere about these changes? Is this likely to be at all controversial? — Martin (MSGJ · talk) 15:11, 16 December 2011 (UTC)
Personally I dislike the whole {{s-line}} family and avoid their use wherever possible, because of the necessity of setting up dozens of subtemplates whose syntax is impenetrable. Instead, I use the {{rail line}} family, which are much easier to use - the only subtemplates are for colours, and even those are optional - |col=8f691e works just as well as |col={{GWR colour}}.
I try for S-line simply because there was other editor last year used it in the Moscow Metro station articles. (It's likely the editor stopped half-way because he didn't know how to deal with the "toward" for the ring line.) So it would be too cumbersome to change them to other template. But I expect some documentation for {{rail line}} to explain its usage. -- Sameboat - 同舟 (talk) 23:43, 16 December 2011 (UTC)
I recently tried to use this in my article La Floresta (FGC) and it did not work properly. (see here). If someone could tell me whats I'm doing wrong here (if anything), I would appreciate it. Thanks, Liam98712:40, 20 February 2012 (UTC)
Hi, I'd like to make a couple of minor changes to this template. I am completely familiar with coding so that is not a problem at all. Can I have access? Thanks, Azylber (talk) 10:23, 14 May 2012 (UTC)
Then, if it all works as expected, describe your changes here (purpose, effects, etc.) and then, if others agree with your amendment, put an {{editprotected}} here, and an administrator will make the amendment to the live version. --Redrose64 (talk) 13:22, 14 May 2012 (UTC)
Hi Rose, thanks a lot for point out the procedure to me, sounds like a very reasonable way to do this. I will now do it and I'll let you know if I have any problems. Thanks! Azylber (talk) 16:46, 14 May 2012 (UTC)
Edit request: categorize in mainspace only
This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request.
Can somebody please fix Template:S-line/CRT right/1 so that it properly displays the disambiguated link, Daxuecheng Station (Chongqing). The documentation provided is completely unhelpful. Following it to the letter yields a bad result. Frankly, this template really needs to be overhauled to make disambiguation more intuitive, without requiring the disambiguator to parse through multiple levels of subtemplates to make what should be a really easy fix. bd2412T04:55, 4 May 2013 (UTC)
Hi, I've taken care of this problem. You were editing the wrong template. This type of problem is fixed by editing the template Template:CRT stations. If you've touched any other templates, please revert your changes. And if you want you can also let me know and I'll help you deal with these or similar problems. But if you modify that template you modified in the way you did it, you'll break something else, so it's very important that other similar changes you've made are also reverted. Let me know if you need any help. Azylber (talk) 17:11, 4 May 2013 (UTC)
And by the way, this template system is used across all groups of articles on rail systems. Disambiguation is really easy because it's always done in the XXX stations template, where XXX is the code of the rail system. It has to be done that way to centralise the disambiguation for all the articles in the group. That XXX stations template is used by many other templates in that same system, and without these scheme it would be necessary to touch many templates just to disambiguate one thing. Hope this helps. Cheers, Azylber (talk) 17:16, 4 May 2013 (UTC)
Is there no way to set it up so that disambiguation can be effected with a simple |dab=(foo) parameter on the template that actually calls the link? bd2412T00:38, 5 May 2013 (UTC)
In my opinion, the current template scheme, that we have in thousands of pages about hundreds of rail systems, is the simplest way to do it. You just change the XXX stations template. I know what you're saying that disambiguators don't necessarily know this, but disambiguation is currently not a big issue at all in this wikiproject, I think we've got it pretty tight. Azylber (talk) 03:04, 5 May 2013 (UTC)
{{s-start}}
{{s-rail|title=Sydney Trains}}
{{s-line|system=Sydney Trains|line=Airport and East Hills|previous=Town Hall|next=Circular Quay}}
{{s-end}}
{{s-start}}
{{s-rail|title=Sydney Trains}}
{{s-line/sandbox|system=Sydney Trains|line=Airport and East Hills|previous=Town Hall|next=Circular Quay}}
{{s-end}}
checking Town Hall railway station, the link text is not white, even though there is a specific font declaration. I was going to address this within the {{Sydney Trains lines}} template, but the link text is used with both coloured and transparent backgrounds, so we cannot simply override the colouring. I thought that the issue can be resolved by changing the <font style="color:#..."> statements to <font color="#..."> statements, but it seems that doesn't work either. any suggestions? Frietjes (talk) 18:27, 11 August 2013 (UTC)
Template:Sydney Trains color defines both color and font color. Can something be done there? This looks like an overuse of color anyway. Most other rail succession templates have simple bands of color and there is no conflict within the text box. Sw2nd (talk) 18:46, 11 August 2013 (UTC)
{{s-start}}
{{s-rail|title=Sydney Trains}}
{{rail line|previous=[[Town Hall railway station|Town Hall]]<br><small>''towards Central''</small>|next=[[Circular Quay railway station|Circular Quay]]<br><small>''towards Macarthur''</small>|route=[[Airport and East Hills railway line|Airport and East Hills Line]] |col={{Sydney Trains color|airport and east hills}} }}
{{s-end}}
There appears to be an typo in the template for the preceding station or following station of Lompoc-Surf that shows up on Goleta and Guadalupe templates as Lopoc-Surf. I am assuming the templates are layered and so I am interested in how this complex template works and how you fix it. Fettlemap (talk) 19:57, 28 January 2014 (UTC)
just fixed a bug when hidemid=y and hide2=y which results in spurious blank lines since the inner cells are not rendered. I also updated the testcases to expose such bugs (added some text above and below the succession box make the spurious newlines more obvious). Frietjes (talk) 15:49, 21 May 2014 (UTC)
Template-protected edit request on 24 June 2015
This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request.
Merge the contents of the /sandbox (inside the <includeonly> tags) into the main template. This, as shown inside the infoboxes on the testcases page, fixes the display problem inside infobox tables where the infobox CSS class overrides the CSS of the <tr> tag—each table cell now has the text-align: center declaration. Jc86035 (talk • contribs) Use {{re|Jc86035}} to reply to me 08:22, 24 June 2015 (UTC)
Hi, still quite unsure about how to add a different terminus station for branch lines for the same main line after reading the main article on s-line. Such example can be seen at Thung Song Junction Railway Station where the mainline has a terminus as it should be, but the Kantang Branch Line does not (having only an open-ended 'towards'). Any solutions on how it should be fixed in order for the branch line terminus to appear as 'towards Kantang' would be much appreciated. Bahndosi (talk) 06:28, 4 July 2016 (UTC)
Trying to eliminate calls to nonexistent "XXX style" templates
If you look at Special:WantedTemplates, you can see that many of the nonexistent templates listed are "XXX style" templates that are called by rail articles, specifically those that use {{S-line}} and similar templates. I have updated {{S-line}} in an attempt to test for the existence of these "system style" templates before calling them, but I have been unsuccessful so far. As far as I know, I have not broken the template, but if anyone can provide any insight as to why S-line is still calling nonexistent templates, I would be grateful. I'd like to get these style templates off of the WantedTemplates list so that it is easier to see other problems on the list.
@Jonesey95: Maybe {{S-line/side cell}}, though I think adding more ifexist functions might make the template less efficient. (At some point it might be better to change S-line to use module subpages like {{Location map}}, so all the info for a system could be stored on one page.) Jc86035 (talk) Use {{re|Jc86035}} to reply to me02:55, 15 October 2016 (UTC)
Yes, I think you're right. We need another {{#ifexist:Template:{{{system}}} style| test before the {{#ifeq:{{{{{system}}} style|showterm}}|No ifeq statement. I have played a bit in the sandbox, but I haven't figured out the impressively nested if statements well enough to figure out where to put it and still show the text that we want to show. I have calls to the sandbox code for S-line and S-line/side cell in User:Jonesey95/sandbox3 if anyone wants to experiment with S-line/side cell and see what the results look like.
added an extra #ifexist. I tested it in the sandbox first, and the testcases showed no problems, so I updated the main template as well. Frietjes (talk) 19:47, 15 October 2016 (UTC)
It looks like that worked. Template:IT-Treno_regionale_style was being called by 236 articles, and after null edits of the articles transcluding it, that number is down to zero. The template is still being linked from a pile of articles, but that doesn't seem to cause any problems. – Jonesey95 (talk) 00:14, 16 October 2016 (UTC)
yes, the #ifexist effectively changes the transclusions to links. there is no easy way, as far as I can tell, to completely eliminate everything in "what links here". Frietjes (talk) 14:21, 16 October 2016 (UTC)
documentation update about when disambiguation for a station name is needed
The documentation here needs to address non-uniform cases! Examples of only "uniform" cases are given, please add a non-uniform example. Or otherwise give a clue about how to handle when a station name is ambiguous, when disambiguation is needed. Searching the documentation for "ambig" gives three items about state1, state2 stuff, but that is no help in my case. Also there are no instances of "pipe" in the document, when I thought pipelinking would be needed.
My problem was that at Puxin Station article where there is a predecessor-successor box (maybe not right language), there was an ambiguous link. The next station, "Yangmei", needs to link to Yangmei Station (Taiwan), not to diambiguation page Yangmei Station.
The code at Puxin Station is:
{{s-rail-start}}
{{s-rail|title=TRA}}
{{s-line|system=TRA|line=Western|previous=Zhongli|next=Yangmei}}
{{end}}
{{TRA Western Line}}
Seeing that code, i came to template:s-line to see what I should change in the template call.
I eventually figured out how to fix the problem, but only from reading 2013 discussion raised by BD2412 above, at #Template:S-line/CRT right/1.
The fix was:
0. make NO CHANGE in the s-line template call. So for me, at Puxin Station article, I needed to restore the "s-line" statement back to how it was originally, before I made reasonable tries like replacing "Yangmei" by "Yangmei (Taiwan)" or by "Yangmei Station (Taiwan)|Yangmei".
1. take a leap and assume that there exists a Template:TRA stations, despite there being no link to any such template at the Puxin Station article(!!!!)
2. despite the template showing nothing understandable, go ahead and edit it. When in edit mode I could see other examples luckily, and following them I figured I should add a line:
| Yangmei=[[Yangmei Station (Taiwan)|Yangmei]]
Some text like here should be added to the documentation I think, perhaps in Q&A form to answer the question "What if a station name is ambiguous? Should pipelinking be used?", being sure to use terms pipelink and disambiguation.
I'm trying to disambiguate an S-line template for Roseville railway station, Sydney which is called from Chatswood railway station. The template points to the disambiguation page Roseville station. Based on what I think I'm reading above, I tried to edit Template:Sydney Trains stations by adding a line "Roseville = [[Roseville railway station, Sydney|Roseville]]" but it seemed to have no effect, so I reverted my edits to the template. Can somebody 'in the know' please look into this and advise on how to disambiguate the link? Thanks in advance! PKT(alk)23:33, 24 November 2016 (UTC)
Wow! - when I tried it and tested the edit, it didn't seem to work..... but it does now. Maybe I should have allowed more time for the template edit to take effect? I dunno, but thank you for checking!! PKT(alk)01:14, 25 November 2016 (UTC)
Train service type and secondary color parameters
Hi, I added the train service type parameter, {{servicetype|}}, and the secondary color parameter, {{2rycol|}} so that you could disambiguate the train service types other than local/stopping service with an optional horizontal color band. The below succession boxes are examples what I applied to.
The reason for the amendment is the current S-line template is not assumed to multiple train services within a short-hauled line/route. For more than a half century, Japanese commuter railways have adopted color systems for their train service types such as Express or Rapid Express, rather than adopting colors for their rail lines/routes.
Hope you understand my intention and this modification helps the S-line template more universal. Thanks – KU (talk) 10:55, 20 August 2016 (UTC)
The point about the {{s-line}} group is that you don't use parameters to specify colours, it's all pulled from the system-specific subtemplates. So I think that this is the wrong approach. Regarding how it should be done, I already did this three years ago for National Rail:
I recognize your smart applications to the NR a few year ago, actually, I tried to refer to those. But your line color (lightcol) stripe practice with <div>~</div> look neat and nice, but not at all when heights of succession boxes is more than two sentense lines. As you may know, lengths of station and line names are relatively long unlike the NR. Besides, the method changing around {{{branch}}} on S-line subpage template for each railway system does not seem practical since there are over 180 rail transit operators even in Japan. That's another reason why I decided to modify the S-line template itself. Hope you undertand the situation. As of parameters to specify colors, it seems to be improved, thanks to Jc86035. Anyway, thanks for your pointing out. KU (talk) 01:27, 21 August 2016 (UTC)
@KU: (edit conflict) Looks nice; could be useful for other complicated systems like the NYC subway. I've modified the template sandbox (and {{Kintetsu color}}) so that |servicetype= is now |service=, and the colour can now be called from Template:[system] color instead of having to be manually entered (this replaces |2rycol=). Jc86035 (talk • contribs) Use {{re|Jc86035}} to reply to me 11:32, 20 August 2016 (UTC)
Would someone, with an administrator status who agree with this amendment, copy the S-line/sandbox, except for the sandbox notice at the bottom, into the live S-line template? Thanks in advance. KU (talk) 07:24, 28 August 2016 (UTC)
@Jc86035: Would you submit the current S-line/sandbox content to the live S-line template if you agree the amendment since I had been not granted as neither a template editor nor an administrator. Thanks KU (talk) 22:51, 26 September 2016 (UTC)
@Redrose64 and KU: Would there be any potential problems with conflicts if the proposed service colours were called with {{{service}}} instead of {{{line}}}~~{{{service}}}? Jc86035 (talk) Use {{re|Jc86035}} to reply to me11:42, 10 January 2017 (UTC)
Wangjiawan Station is now a disambiguation page. Please make whatever adjustments are needed to the following articles to allow the links to point to the correct station:
I don't get it about colors you did not give the instruction of creating color but first how to create color for example red blue green Armanjarrettp (talk) 13:32, 28 August 2017 (UTC)
There was a problem! on this template | services= there was a name "Santa Fe Southern Railway to Santa Fe" on service infobox how to fix this?
Here this sample check the service
Lamy
Services
{{s-rail|title=Amtrak}}
{{s-line|system=Amtrak|line=Southwest Chief|previous=Albuquerque|next=Las Vegas}}
{{s-note|text=Former services}}
{{s-rail-next|title=ATSF}}
{{s-line|system=ATSF|line=main|previous=Twitchell|next=Glorieta}}
{{s-line|system=ATSF|line=main|previous=Albuquerque|next=Las Vegas|notemid='''Major stations'''}}
{{s-line|system=ATSF|line=Santa Fe Branch|previous=Santa Fe}}
[[Santa Fe Southern Railway]] to [[Santa Fe Depot (Rail Runner station)|Santa Fe]]
{{s-rail-next|title=SFSR}}
{{s-line|system=SFSR|line=Santa Fe Southern Line|previous=Santa Fe|notemid=''Closed in 2014''}}
@Armanjarrettp: What are you trying to do? I cannot understand what you're saying. (Please sign with four tildes ~~~~.)
[[Santa Fe Southern Railway]] to [[Santa Fe Depot (Rail Runner station)|Santa Fe]] is in the code of the template. Did you add it? Are you trying to use {{S-line}} with it? Do you want to remove it? Jc86035 (talk) 16:11, 2 September 2017 (UTC)
Template issue
What happend this template?
first i created this <code>Los Angeles</noinclude>[[Category:Atchison, Topeka and Santa Fe Railway templates]]</noinclude></code> lated on i have many times to edit this but is not work to toward right. Whats happend it is blocked?
@Railfan01: This is already what the small text saying "toward[s] Terminus" does, so I don't think adding the columns is necessary or imparts additional information. Using the French Wikipedia layout would also make the table unnecessarily wide, especially where the template is used in infoboxes. Jc86035 (talk) 13:25, 5 November 2017 (UTC)
The {{s-line}} template is just one of several dozen different succession box templates that may be used between {{s-start}} and {{s-end}}, which share a common layout (see WP:SBS). Adding more columns would not fit in with that scheme. --Redrose64 🌹 (talk) 15:29, 5 November 2017 (UTC)
Help please
There are a number of pages that include a template invocation that reads something like this: {{s-rail|title=MOSMETRO}}{{s-line|system=MOSMETRO|line=Filyovskaya|previous=ArbatskayaFL|type=Both}}{{s-line|system=MOSMETRO|line=Arbatsko-Pokrovskaya|transfer=ArbatskayaAPL|previous=SmolenskayaAPL|next=Ploshchad Revolyutsii}}{{s-line|system=MOSMETRO|line=Sokolnicheskaya|transfer=Biblioteka Imeni Lenina|previous=Kropotkinskaya|next=Okhotny Ryad}}
The issue is with the last {{S-line}} template, which invokes {{S-line/side cell|through=|state=|branch=|next=Okhotny Ryad|system=MOSMETRO|line=Sokolnicheskaya|note=|type=|oneway=|round=|circular=|side=right}} That, in turn, invokes {{S-line/MOSMETRO right/Sokolnicheskaya}}, which returns the text "Bulvar Rokossovskogo". However, there are two Moscow Metro stations by that name. Since this template is for information about the Sokolnicheskaya line, it should link to Bulvar Rokossovskogo (Sokolnicheskaya Line). However, I can't figure out which of the many intertwined templates needs to be edited to include the parenthetical in the link without messing up the text displayed in the route box. Can anyone please help? --R'n'B (call me Russ) 18:33, 13 November 2017 (UTC)
@Frietjes: Here's a similar issue: {{s-line|system=IT-Treno regionale|type=Malpensa Aeroporto|type2=Milano Centrale|previous=Milano Porta Garibaldi|next=}} produces the text shown below, linking to the disambiguation page Malpensa Aeroporto railway station.
@Frietjes: The editing required to make a fix is unduly complex, which is problematic for even for advanced editors. Please incorporate an easier disambiguation parameter wherever an ambigous link is possible. bd2412T15:06, 22 November 2017 (UTC)
@Frietjes and BD2412: I made this change and this change, since according to the S30 map, the line goes to Terminal 1 first, then Terminal 2 is the terminus. this leaves only one page left which is linking to the disambiguation page, and that is Milan Central railway station. if you check that article, you will find
{{s-line|system=IT-Treno regionale|type=Malpensa Aeroporto|type2=Milano Centrale|previous=Milano Porta Garibaldi|next=}}{{s-line|system=IT-Treno regionale|type=Malpensa Aeroporto|type2=Milano Centrale|previous=Milano Porta Garibaldi|next=}}
which makes no sense. why would you have the same line twice. but, if you look directly below there, you will see a map for Malpensa Express, so I am assuming that one of these two s-lines are for that line? if so, which line is the other one? in any event if you change |type=Malpensa Aeroporto in that article to |type=Malpensa Aeroporto Terminal 2, the problem goes away. and, unless someone can tell me why there is are duplicate lines there, I would merge them into one. the next clue would be that the following station, Milano Porta Garibaldi railway station, only lists one "Treno regionale" line. Frietjes (talk) 17:39, 22 November 2017 (UTC)
@Frietjes: Would it be worthwhile to convert this template to Lua/Wikidata? Confusion with the succession templates system seems to be a common theme. Jc86035 (talk) 15:57, 24 November 2017 (UTC)
Jc86035, hard to say. there are so many subtemplates that migrating them all would be a very big undertaking. I'm not sure how the submodules would be grouped, or what would be involved to clean it all up. Frietjes (talk) 15:30, 25 November 2017 (UTC)
The Moscow Metro templates were actually fixable by fixing the links in the template itself. It would be nice if all the rail templates worked this way. bd2412T16:01, 11 December 2017 (UTC)
the problem is that the link to the dab page is frequently generated by the "toward" link, which is generated automatically by the "left", "right", and "stations" line templates. the entire point of this system is that you correct it on one place, rather than correcting it in a dozen different articles. almost always the fix is to edit the "stations" template, like I did here to explicitly specify the link used for the station, rather than relying on the standard pattern. to me, it's easier to fix in one place, rather than 15, but I agree there is no documentation on how to do this. the alternative would be to use {{rail line}} where nothing is automatic, but the drawback there is that the style may be inconsistent for different stations on the same line (you have to specify the color, left, right, etc in every article). Frietjes (talk) 16:12, 11 December 2017 (UTC)
Change in Terminus
Hello. I'm looking for assistance for changing one of the branch terminus of the Northeast Regional using {{s-line}} template. The routing changed from Lynchburg to Roanoke in the past month. However, I cannot find a way to change the terminus from Lynchburg to Roanoke using {{s-line}}. Do I need to change the {{s-line|type2=}} or is it something more complicated? Thanks. FunksBrother (talk) 17:46, 11 December 2017 (UTC)
Ah. Thank you so much. I clicked on the article for the Template to change the terminus from Lynchburg to Roanoke. Hopefully the change will start showing up soon. FunksBrother (talk) 18:01, 11 December 2017 (UTC)
Hi. I have been working on a Lua version of this template, which would theoretically load faster and eliminate the need to have a bunch of succession templates. It also allows for more customization. As an example, I've created Module:L-rail/Taiwan HSR used here. What do you think?
I'm hoping each system can have its own module to suit its need. This particular example module can be stacked like s-line, as shown in my sandbox. Szqecs (talk) 09:25, 17 January 2018 (UTC)
@Szqecs: I don't think this would be the best approach, though it's a good start. I don't think each system needs its own complete module, since every system is going to need to generate a table and have preset translations; the current system of having one template and a lot of data pages – which works almost all of the time, though local/express designations would need to be added somehow to replace the Japanese templates – could be changed to be a system with one module and one data page for each system (somewhat like Module:HK-MTR stations/data, though I would return everything as return p with p being everything in a table).
With a Lua approach I would probably have one container template with numbered parameters like those in Module:Infobox (|system1=, |line2=, |prev2=, |next2=…), which would allow cells to be merged automatically (either by auto-filling empty parameters, or by merging identical cells). If Wikidata isn't banished by RfC it could also be possible to auto-fill all prev and next parameters, or even auto-fill the entire table. The data pages could also be reused in a {{Rail-interchange}} module (which should have been made ages ago).
There's already Module:Rail transport colors, but I think keeping separate data pages for each system would be better since it would prevent all the data from having to be template-protected. Module:MTR would need to be converted to this format. I'm not sure what happens to the templates if the Lua conversion is done, but some of them would probably remain as frontends like the current {{HK-MTR stations}}. Jc86035 (talk) 10:22, 17 January 2018 (UTC)
Not necessarily 'every' system needs its own module. I'm thinking there be a manual version where you fill out everything. Maybe a 'standard' version that works more or less the same as S-line. However, the discussion you mentioned is the reason why each system should be 'allowed' to have its own module. Different systems have different characteristics. The example module I created is a rather simple system, so it can contain all the data and not have to reference anything, which is efficient. A more complex system can't do this and needs to be coded differently. Szqecs (talk) 11:03, 17 January 2018 (UTC)
@Szqecs: All transit systems share characteristics like having lines, stations and termini (which is why the current template works in the first place), so the main module would probably be the only one which needs to do formatting. This would make the structure for data pages simpler, since they would just be local p = {lines = {line1 = {data tables}, line2 = {data tables}}, stations = {data}} return p or local p = {lines = {data}, color = {data}, left = {data}, right = {data}, branches = {data},… } return p instead of needing to have their own functions.
There are multiple other systems which use local and express designations, such as the New York City Subway (and a stripe option |lightcol= already exists in {{Rail line}}, though it's for specifying a line colour in addition to an operator colour). If a system needs some other custom thing then it could just be coded into the main template as an option if desired. If it already has some unique characteristic then it probably already uses {{Rail line}} and can keep using it if it's really the only transit system in the world that does something.
I don't think having a "manual" version (does this mean the whole module is self-contained?) would improve performance measurably and it shouldn't really be an issue unless a station has 1,000 or more connecting services. Jc86035 (talk) 11:34, 17 January 2018 (UTC)
Well, consider this. Many metro systems have station codes. Say I'd like the module to be written so that I can just input the codes and have it work. To have this feature, the module will need code to interpret the station codes, which is system-specific. Can this be written on the 'data pages'? I don't think modules can invoke other modules. Does it make sense to have all systems run through code for a feature it doesn't use? Should the main module have every conceivable feature? Not to mention there is the template protection problem. Szqecs (talk) 12:05, 17 January 2018 (UTC)
Also, for the MTR example, there are still separate pages for stations, lines, color etc. My goal is that for simple systems such as THSR, there isn't a bunch of data pages like {{THSR color}} containing next to nothing. Szqecs (talk) 12:25, 17 January 2018 (UTC)
@Szqecs: The station codes would probably be handled in an aliases table in the module or a subpage of it (what I meant by "data page": a Lua module containing a table, which is the only object returned, such as Module:ISO 3166/data/AU). Modules can load data from other modules. What do you mean by "control structures"? If you're referring to the use of the {{#switch:}} parser function you could have a default of e.g. '[[%s station|%s]]' and then insert the station name in a function in the main module by using string.format() or mw.ustring.gsub(). This wouldn't really be any more efficient than having a hundred entries of { ABC = 'ABC station', XYZ = 'XYZ station', … }, though it might be easier to maintain. Wikitext templates are different because it's much more efficient to have a one-to-one table in Lua than it is to construct one with {{#switch:}}. You might want to ask on WT:Lua for Lua-related issues if you want to clarify anything. Jc86035 (talk) 13:54, 17 January 2018 (UTC)
Yes that's what I meant by control structures. What do you do when the station article doesn't fit the default pattern (like how Taipei doesn't fit the default pattern of {{THSR stations}}, which btw is system-specific itself)? Is the main module gonna recognize every station in the world? Szqecs (talk) 14:44, 17 January 2018 (UTC)
@Szqecs: You can import the table out of the data module. You don't need a function for every system. Something like this (obviously with the usual Module:Arguments and a local function reused in each row and stuff like that) would be able to return [[Taipei station|Taipei]] or [[$Name HSR station|$Name]] if there were no entry in the stations table.
-- Main module (proof-of-concept). Module:Arguments and basically everything omitted for clarity, so this will basically only return a station name based on a data pagelocalp={}functionp.findStation(frame)localargs=frame.args-- System would be handled differently in a module allowing multiple systems and would be loaded somewhere else before being used by this functionlocaldata=mw.loadData('Module:S-line/data/'..args.system)-- Since there's only one variable here mw.ustring.gsub might be better?locallink=data.stations[args.station]orstring.format(data.stations['#default'],args.station,args.station)returnlinkendreturnp
-- Data subpage. No aliases table for nowreturn{lines={['Main line']={color='#C35617',link='[[Taiwan High Speed Rail]]',left='Nangang',right='Zuoying',},},stations={['#default']='[[%s HSR station|%s]]',['Taipei']='[[Taipei station|Taipei]]',},}
Edit: Before proceeding any further, you mentioned that this approach wouldn't be more efficient than having a bunch of entries. So you care about efficiency, which I assume you meant load speeds. If so, wouldn't having separate modules be a lot more efficient? It would only execute necessary instructions, at the cost of taking up more space, which is arguably not a lot. Why does it bother you that there be duplicate code? Also, you said that all transit systems share characteristics like having lines, well in the case of THSR, lines is not one of them. There is no THSR 'Main line' you constructed. So using a general template for THSR, would you need to key in 'Main' as the line? As I said, systems differ, so should the modules. Szqecs (talk) 18:00, 17 January 2018 (UTC)
@Szqecs: What does a transclusion of your (ideal) template look like? The current use in Taichung HSR station is incomprehensible for me and you should retain more features (particularly the named parameters) from the current template to avoid alienating users. Many editors do not like change (especially for change's sake), and if Wikidata is successful it will not be necessary to have most parameters in about five to ten years anyway, so you may as well avoid changing the parameters too much. It is generally a good thing to avoid duplicate code since otherwise every module has to be updated (for consistency) if there's a style change or a new feature that should be added, and most editors cannot write Lua and would probably end up doing it wrong. It's probably best to make the data pages as simple as possible while keeping the complicated stuff alone. Furthermore it would take somewhat more work to convert the existing templates to that system. Why would you want to duplicate code when it's trivial to just use mw.loadData?
What I meant about efficiency was that I assumed you cared about it enough to take it into account, and it doesn't really matter (as much) with Lua modules in any case so I think it's fine to have some increase in load time for ease of use.
If you had a main module, you could set it so that e.g. args.line = args.line or '#default' and then have just an entry for ['#default'] in the data subpage lines table. Jc86035 (talk) 03:50, 18 January 2018 (UTC)
@Szqecs: I'm not sure I have time to do it, though you should try to keep all the functionality from the existing template. Using a table to be iterated through (even with station[#stations]) would require all stations for all permutations of a multi-branch route to be entered into separate tables, which would be quite tedious and not user-friendly; and the conversion to the new template would take aeons because station lists would have to be generated manually for every system. (Furthermore, it would be basically impossible to use with Wikidata data.) The current method of specifying just the termini would probably work better and would be less complicated, though editors would have to manually enter previous and next stations. You could modify parameters for local/express services and branches by iterating through a table in a branches = {branch1 = {modified_parameter_to_replace_default = new_value, …}} table, though of course there are other ways. Jc86035 (talk) 03:50, 18 January 2018 (UTC)
My ideal transclusion is this. The first parameter does what {{S-rail-start}}, {{S-rail}} and {{S-end}} do: indicates the row type. It's demonstrated here. The second parameter is the ordinal index of the station on the line. As you can see, this module is much easier to use compared to S-line, so I'm not simply changing for the sake of changing. How to transclude and how to edit can be explained in documentation just like S-line. The underlying code is certainly not any less comprehensible than S-line.
I'm not against having a universal version. But if you don't have the time to make it, why would anyone else? I've created Module:L-rail/Taiwan HSR with minimal effort, and with some tweaking, similar modules could be used for the vast majority of systems. If enough of them are created, naturally there will be a universal version. Why jump the gun? Szqecs (talk) 04:52, 18 January 2018 (UTC)
Please don't convert any of this to Lua. Often I assist in resolving problems of the type "how do I link to the desired station/line and not to a dab page", and I do this by tracing the existing code through, using the WP:SUBST feature and a sandbox if necessary. Doing this usually shows me that a hitherto-missing parameter should have been used. It will not be possible to do this with Lua, since you cannot find out which parameter names are valid. Even if you do know that one is valid, finding out what it does is extremely difficult. --Redrose64 🌹 (talk) 11:02, 18 January 2018 (UTC)
Are you talking about the talk section below this one? Isn't the solution to go to the stations template and use #switch? How is that not possible with Lua? Lua has way more control structures available (if a then b else c, that sort of thing). Szqecs (talk) 11:50, 18 January 2018 (UTC)
If I open a normal template for editing, I can find out which parameters are valid by looking for triple opening braces. This is impossible with Lua. --Redrose64 🌹 (talk) 12:50, 18 January 2018 (UTC)
Let's say that I find a template without documentation. How do I know what parameters to feed into it? One way is to trace through the template code. In template code, all parameters (without exception) may be identified by three consecutive opening braces; so I look for those. Consider Template:WikiProject English Language, for which I wrote the documentation a few days ago, after I found that it looked like this. In order to write that doc, I needed to know which parameters are recognised, and what their valid values were. So I opened up the template for editing, and found this. Notice that there are six occurrences of triple opening braces. Taking from there to the next pipe (or closing brace) we find: {{{small, {{{category, {{{listas, {{{class, {{{auto and {{{importance. So the valid parameters are |small=, |category=, |listas=, |class=, |auto= and |importance=. Anything else - such as |Foo= - is invalid.
In general, you cannot do this with Lua modules. Some people, such as RexxS (talk·contribs), are careful to make parameters more easily identifiable, but there is no guaranteed universal method the way that there is for templates. --Redrose64 🌹 (talk) 15:52, 19 January 2018 (UTC)
@Redrose64: Parameters enter Lua modules as frame.args so you can search for that and you'll find the parameters. If you're saying wiki code is easier to understand, please explain to me how the code of S-line works. Szqecs (talk) 17:33, 20 January 2018 (UTC)
@Szqecs: For an example of an item which has (complete) adjacent stations data in Wikidata, see Yau Ma Tei station (Q838420). This can be obtained in Scribunto, and the item only needs to be requested once to return a table of all of its data. I believe it is also possible to access data for arbitrary items, which would allow line colours and other information (e.g. "toward" vs. "towards") to be obtained. This is partly why I would favour having one template generate all the code, instead of having one template for each row (also the issues with manually combining cells in the current template). Some of the problems with Wikidata usage currently are that not enough people are able to deal with vandalism in a timely manner, and not enough statements have reliable secondary sources to a degree which would totally satisfy English Wikipedia policies and guidelines (though this could probably be said for many WMF wikis). Some editors have spent many hours fighting about these things. This is why I said it would only happen in five to ten years.
Why would you not want a universal version? It already exists as {{S-line}}, and there just aren't enough Lua-competent editors to expect a module to be written for enough systems. I have already linked to all of the S-line helper modules that currently exist in this discussion, and Scribunto has been available for about five years (and S-line for eleven years). Your module/template does less than S-line and only does it for one railway line. If a template is redundant (and less functional than something else) someone will probably try to merge, delete or replace it for being redundant at some point, and it is perfectly valid to do so without any other reason. For example, there are thousands of different logos and icons stuck into {{Rail-interchange}}, some of which were originally in their own simpler templates; and at least twenty national- and system-level rail station infoboxes (one of which I made) have been merged into {{Infobox station}} for similar reasons. Some templates (like the ones you mentioned) are harder to merge than others, so {{Infobox GB station}} will be around until someone makes a module or child infobox for generating station traffic infobox rows (I was probably supposed to do it two years ago so the template could be put up for being merged, but didn't get around to doing it).
I understand and would encourage the use of numbered parameters (if it doesn't make the template too complicated), but I have no idea why you would want to use numbers in place of the station names. This is bad for usability and makes the template relatively indecipherable because the entered text doesn't correspond in any way to the output text. Having parameters for the previous and next stations to be entered manually is more intuitive, I think, is more consistent with the rest of the S-series of succession templates, and avoids issues of pieces of data only being used once or twice (also grounds for deleting a template, though these ones would probably escape that).
I don't have time right now to write the module(s). If you want to write one first I can't stop you.
(By the way, consider looking at other Lua modules to look at WP conventions for writing them, such as the use of Module:Arguments, using the variable name args for the arguments table, and using more self-explanatory variable names instead of abbreviated ones. This makes it easier for editors like Redrose64 to read modules without documentation, though it'd be better to just write the documentation.) Jc86035 (talk) 17:00, 18 January 2018 (UTC)
I'm not yet familiar with Wikidata, so I can't make use of it yet.
there just aren't enough Lua-competent editors
I can tell you this: the time it took me to figure out how S-line and parser functions work was about the same as going from knowing nothing about Lua to creating Module:L-rail/Taiwan HSR. And the code for S-line, I still don't understand. When I first started using S-line, I ran into the disambiguation problem like everyone else. If I weren't interested in templates, I would have just left pages outdated. S-line isn't any more user friendly than a Lua version could be.
Your module/template does less than S-line
It does less than S-line because it needs less. I don't know how else to explain it to you.
Some templates (like the ones you mentioned) are harder to merge than others
Exactly. Same issue here. It is rather difficult to write a module that applies to all systems.
why you would want to use numbers in place of the station names
Because the transclusion can be shorter. That's the point of templates. If you have to input the previous and next stations, you would have 2 times the number of station names, all on the page, whereas if you had just a list, it would only be 1 times, and the list would be behind the scenes. As for ease of use, with S-line you still have to deal with disambiguation and deviations from default pattern, so is it really easier? Szqecs (talk) 17:56, 18 January 2018 (UTC)
@Szqecs: Most heavy editors joined in the 2000s, before Scribunto existed (and before Wikidata existed). Quite a lot of them can't or refuse to learn Lua, and it's a mostly valid usability issue for them if Lua is used in place of wikicode templates without being significantly better than the older, working templates. Furthermore, many Wikipedia editors are not technical people and will not go out of their way to spend time figuring out how complicated stuff works. {{S-line}} is quite difficult to understand (and a lot of the code is hidden away in {{S-line/side cell}}), but the documentation should explain most of the parameters.
If you don't want to replace the entire thing, there's no point in duplicating existing functionality because it's never going to be taken up and will probably be deleted at some point. People will delete your hard work. The {{Routemap}} module had to be worked on for years by multiple editors across Wikipedias before it was able to replace the template-based {{BS-map}} and its almost 100 subtemplates, and a lot of editors hated it (particularly the new syntax, which isn't based on wikicode) and actively removed it even where it surpassed the functionality of the older templates. The only reason they tolerated its existence is because some uses of the old templates refused to load at all and had to be replaced. Jc86035 (talk) 03:46, 19 January 2018 (UTC)
If you don't want to replace the entire thing
Do you mean replacing the code of S-line or creating an alternative version like with {{Routemap}}?
I don't think the former is feasible. {{BS-map}} wasn't just replaced with a Lua version because it's too big of an impact.
It's difficult to write a template completely differently and have all existing tranclusions still work.
It would limit how the template could be improved.
It would alienate editors like you mentioned. Basically, S-line is protected for a reason.
The latter is more do-able. Routemap isn't deleted because there are no grounds to do so. According to Wikipedia:Templates for discussion, only if the template is 'redundant to a better-designed template' should it be deleted. In this case it is BS-map that should be deleted actually. A template that is written completely differently and used differently can hardly be considered 'redundant' IMO. If the use of the new template grows over time, starting with lower-profile systems, there would be more time for editors to adapt. As with BS-map, those who want to keep using S-line still can.
If neither approaches are feasible, we just wasted a lot of time here haven't we? You could have just told me this from the start. Szqecs (talk) 05:31, 19 January 2018 (UTC)
without being significantly better than the older, working templates
What I propose has an improvement and here is a real example.
I'd like stations to display the types of services that call there. With S-line, as far as I know, the type parameter can't achieve this. This can only be done by treating services as lines or branches, which requires more pages to be created, or by using notemid, which you will need to add for every station.
To have this feature I want, I would need to request a change to S-line and someone would have to understand the code to add this feature. For such a niche change, an editor like myself should be able to just add the feature and not have to worry about every transclusion of the template. A template that is easier to modify is 'significantly better'. Szqecs (talk) 07:10, 19 January 2018 (UTC)
@Szqecs: I think it would be possible to replace it gradually if you had something like service types that couldn't be done very nicely in the existing template, but you would have to have the goal of being able to supersede {{S-line}} and it would have to be possible to replace all existing transclusions. {{Rail line}} still exists and it's been eleven years since it could have been replaced entirely, so you don't have to replace it as soon as possible. However, I would avoid having to add new data like station lists because then all of it would be made redundant if Wikidata were to be enabled for the template. Jc86035 (talk) 12:32, 19 January 2018 (UTC)
Arbitrary break 2
@Jc86035: Hey, I realized that writing a universal version is perhaps a lot easier than I thought. I was making a system specific one when I realized that the specific parts can be moved to another module and loaded, including functions to interpret station codes and deal with station link patterns. Check it out:
So far it's good, though I would make the variable names more comprehensible so that it's easier for other users to edit the module in future. What's the variable "interpret" for? You haven't defined it anywhere in the module. Jc86035 (talk) 15:22, 20 January 2018 (UTC)
What I'm planning is this: The first parameter is the system. The module first loads the module for the system; in this case Kaohsiung. There are two right now but I plan to merge them. The system module can have an interpret function that defines what other parameters are for; in this case the 3rd and 4th parameters are the station code. If there is no interpret then it uses a default interpretation, which I'm still designing. I'll probably allow for manually inputting adjacent stations like S-line. I'm also trying to get all lines to be done in a single invoke. Szqecs (talk) 15:56, 20 January 2018 (UTC)
Missing .. before ' station|' on line 7, so it looks like calling function x(' station|') rather than a concatenation? Certes (talk) 11:52, 26 January 2018 (UTC)
@Narky Blert: Please don't put {{dn}} tags into the |previous= and |next= parameters, this breaks the linking horribly.
If the station that is to be linked to has parenthetical disambiguation, the |state1= and |state2= parameters of {{s-line}} may normally be used (without the parentheses) to supply that disambiguation. In this case, comma disambiguation is employed, and the actual fix was to this subtemplate. --Redrose64 🌹 (talk) 10:56, 18 January 2018 (UTC)
It would be preferable to improve the {{S-line}} template itself with a common parameter like "dab=" so that editors do not need to hunt down other templates to fix. New articles on stations are written every week, rendering existing station names ambiguous. bd2412T12:16, 18 January 2018 (UTC)
Can you add an example of a working use of those parameters to the template documentation? It is not clear where they need to go, or whether any other parameters need to be changed for their use. bd2412T15:04, 18 January 2018 (UTC)
They're named parameters; the positioning is immaterial. No other parameters need to be altered. Compare the following:
They look identical, but the links differ. The values are passed by {{s-line}} through the |state= parameter of {{S-line/side cell}} into the |state= parameter of the relevant stations subtemplate which may then use the value in any way that might be appropriate. In this way, |state1= can modify the link generated by |previous=, and |state2= can modify the link generated by |next=, as shown above. --Redrose64 🌹 (talk) 21:54, 18 January 2018 (UTC)
I seem to recall having trouble making that work in the past, but I don't have a specific instance handy. I will try it going forward, and report back if there are any problems. bd2412T22:21, 18 January 2018 (UTC)
"state1, state2 Allows the passing of an additional station parameter. Useful for disambiguation."
"Please don't put {{dn}} tags into the |previous= and |next= parameters, this breaks the linking horribly."
I am well aware that {{dn}} tags can make pages look ugly. But, this is not my problem. It is your problem. The links were bad, and I could find no obvious way to fix them. I read the documentation, such as it is. I found the problem insoluble, even after having fixed 50,000+ links to DAB pages. A {{dn}} tag outside a {{s-line}} tag generates an unlocalised tag at the top of the article, with no guide to other disambiguators as to what the problem might be.
"As the documentation says, you can fix this by editing the "stations" succession template; in this case {{Transperth stations}}." Where was I supposed to have found that? I wasted 15 minutes of my life trying to solve the original problem, and am wasting more time now by posting here.
I suggest: new fields |previous-link= and |next-link=. A simple solution for any disambiguator faced with such problems, which would cope with both parenthetical and comma DABs. Narky Blert (talk) 23:40, 19 January 2018 (UTC)
I agree - it is always easiest to have a parameter that lets you put in the actual target link, so that exceptions to the usual naming scheme don't throw the template off. bd2412T00:39, 20 January 2018 (UTC)
Disambiguation of a station, the clue is in the phrase "additional station parameter".
Surrey isn't a state either.
Where have I come across links broken by {{dn}} before? Ah, here.
It's not difficult to see which subtemplates are used. First go to the problem article and open it up for edit, find the relevant template code, in this case it's
and copy it to your clipboard. Then go to WP:SANDBOX, open it for edit, paste in that code and click Show preview. At the bottom there will be a list headed "Templates used in this preview" (which you may need to expand by clicking the right-pointing triangle), look for the word "stations" in this list and there is the link to Template:Transperth stations.
If you feel that separate link parameters are necessary, it's probably better to use one of the {{rail line}} templates. Four parameters (three if it's a terminus, five if you want a horizontal coloured stripe in addition to the two vertical ones); no subtemplates. --Redrose64 🌹 (talk) 10:44, 20 January 2018 (UTC)
Follow the instruction that I gave beginning "It's not difficult to see which subtemplates are used." Doing this, I find that it's Template:ATSF stations, hence, this edit.
Please tell me that you're having a laugh. I have no intention of learning the intricacies of how to disambiguate badly-written templates like this one.
It's not badly written; it's complicated because it was presumably designed to be able to handle all sorts of disambiguation and other quirks (like multiple line termini and links to non-stations) for the convenience of editors. If you ever decide to bother to find out how it works, all the information you need is in the documentation (I've linked the relevant section; only the first two subsections should matter for article disambiguation). Jc86035 (talk) 12:09, 21 January 2018 (UTC)
I agree. However complicated the template is, how hard can it be for seasoned template editors to add #IFEXIST parameters allowing a specific link to be designated in place of a disambiguation link for a given preceding parameter? All of this discussion could be spared if there was a way to put |link= (or maybe |link1=/|link2=) after the parameter containing the ambiguous term, and then add a ==Disambiguation links== section to the documentation that shows the wikitext to be implemented to make that fix. bd2412T02:07, 22 January 2018 (UTC)
I today came across another bad link to this template. Using the "helpful" instructions above, I managed to fix the problem in only about 10 minutes. Narky Blert (talk) 02:24, 23 January 2018 (UTC)
Many thanks! To be clear (for the documentation), we put the full text of the target link here, and it will override the previous parameter? bd2412T15:56, 26 January 2018 (UTC)
This edit request to Template:S-line has been answered. Set the |answered= or |ans= parameter to no to reactivate your request.
Please replace the following:
{{notice|This template is called by {{t1|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.}}
With this:
{{notice|This template is called by {{tl|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 is simply to correct a typo; "Template:T1" redirects to "Template:Tl" specifically because it is a common typo (confusing the letter "l" and the digit "1"), but the typo should still be fixed. Jdaloner (talk) 23:49, 17 April 2018 (UTC)
Done I have moved the notice to the /doc subpage and corrected the error you identified — Martin (MSGJ · talk) 11:31, 18 April 2018 (UTC)
Yes, Milford Secondary shows that the Milford branch bypassed Milford Depot (no article) and joined the main line to run through Milford Yard (no article). Both are in Milford, Massachusetts. The fact that the terminus was in Milford is recorded in {{S-line/NYC left/Milford Branch}}. I've added a line to {{NYC stations}} to link Milford exceptionally to the town rather than to a station which was never built. That should fix it. No other pages seem to be affected. Certes (talk) 10:26, 17 June 2018 (UTC)
The example under Transfers could be more accessible. The issue is that the heading of the first row, middle column, does not apply to the entire column. I believe this will cause screen readers to treat North London Line as if it were part of the London Overground.
I believe a more accessible example would be the following, for which the column heading for the middle column actually does apply to the entire column:
What we really need is a fast way to find the modules that generate these links. One way to do that would be to have a bot set up regular lists on the module talk page of all the links invoked in the module, so that if a link becomes ambiguous, an editor can just look for "Module talk" links on the "What links here" page to figure out which module needs to be changed to fix the link. bd2412T13:08, 13 March 2019 (UTC)