Template talk:Adjacent stations
| This template does not require a rating on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | ||||||||
| ||||||||
| Template:Adjacent stations is permanently protected from editing as it is a heavily used or highly visible template. Substantial changes should first be proposed and discussed here on this page. If the proposal is uncontroversial or has been discussed and is supported by consensus, editors may use {{edit template-protected}} to notify an administrator or template editor to make the requested edit. Usually, any contributor may edit the template's documentation to add usage notes or categories.
Any contributor may edit the template's sandbox. Functionality of the template can be checked using test cases. |
| Pages related to |
| Module:Adjacent stations |
|---|
| (talk | sandbox | sub-pages) |
| {{Infobox station}} |
| (talk | sandbox | testcases) |
| {{Station link}} |
| (talk | sandbox | testcases) |
| {{Station icon link}} |
| (talk | sandbox | testcases) |
| {{Rail color}} |
| (talk | sandbox | testcases) |
| {{Line link}} |
| (talk | sandbox | testcases) |
| {{Rail icon}} |
| (talk | sandbox | testcases) |
| {{Rail color box}} |
| (talk | sandbox | testcases) |
| {{Adjacent stations}} |
| (talk | sandbox | testcases) |
| {{Line terminus link}} |
| (talk | sandbox | testcases) |
Line merged including right side which shouldn't be
[edit]The following code should have the second line marked with the right being the terminus:
{{Adjacent stations
|system1=National Rail|line1=London North Eastern Railway|type1=Highland Chieftain|left=Aviemore or Carrbridge Sunday
|line2=ScotRail|type2=Highland Main Line|left2=Aviemore or Carrbridge
|line3=ScotRail|type3=Highland Main Line|left3=Aviemore or Carrbridge|right3=Inverness Airport|to-right3=Inverness Airport|note-right3=(Sundays only)
}}
Instead, the second line--including the right--is completely merged into the third. How can I keep the right side separate while having the rest of lines 2 and 3 merged? Animal lover |666| 12:28, 1 June 2025 (UTC)
- You need to have something in
|right2=. I hacked it like this, which is probably not what you want:
| Preceding station | Following station | |||
|---|---|---|---|---|
| Aviemore or Carrbridge (Sunday southbound only) towards London King's Cross
|
London North Eastern Railway | Terminus | ||
| Aviemore or Carrbridge towards Perth
|
ScotRail | towards Inverness
| ||
| Inverness Airport (Sundays only) Terminus
| ||||
- You should be able to improve upon that hack. – Jonesey95 (talk) 12:42, 1 June 2025 (UTC)
Data module not recognizing through service
[edit]Obu Station's adjsta broke, when I was trying to list a service that continues to Nagoya Station beyond Obu, the usual terminus of the line. I wanted the adjstn to say "Kyowa towards Nagoya" instead, but I have no idea how to do that, and when I try the page warns me of errors so here I am. AlphaBetaGamma (Talk/report any mistakes here) 13:00, 19 June 2025 (UTC)
How to reverse direction/swap termini?
[edit]If a line is defined as being from A to B, is there a better way to make it display as B to A in an invocation of this template, other than manually specifying a different terminus to override the default? Manually adding to-{left,right}N isn't too cumbersome, but I'm wondering if there's a way to avoid having to hardcode the terminus. The stop where I'm having this issue is Santa Apolónia, in Lisbon. Here's a shortened table showing the issue: the last two entries are lines defined such that Santa Apolónia would be on the right side and Caldas da Rainha on the left:
| Preceding station | Following station | |||
|---|---|---|---|---|
| Terminus | InterRegional | Lisbon-Oriente towards Tomar
| ||
| Regional | ||||
| Entrecampos towards Caldas da Rainha
| ||||
| InterRegional | ||||
(For comparison, here's the output with no use of `to-rightN=...`:
| Preceding station | Following station | |||
|---|---|---|---|---|
| Terminus | InterRegional | Lisbon-Oriente towards Tomar
| ||
| Regional | ||||
| Entrecampos towards Lisbon-Santa Apolónia
| ||||
| InterRegional | ||||
)

(Swapping the direction here matches the direction of travel too, as this station sits on one corner of the triangle defined by the Northern line, Cintura line and the Xabregas direct curve. The two top entries connect to/from Lisboa-Oriente through the Northern line, and the ones that need swapping reach the Cintura line through the direct curve.)
njsg (talk) 17:17, 5 October 2025 (UTC)
- If it's just one station, it's usually easiest to just use the to- parameters. If it's a whole section of a line, you could create a second entry for the line in the adjacent stations data module - called it "[linename]-reversed" or whatnot. Pi.1415926535 (talk) 20:57, 5 October 2025 (UTC)
Aliases not working for Module:Adjacent stations/GO Transit
[edit]For some reason the GO Transit line aliases are not working. Using the full line name works but the aliases do not.
Aliases work fine for other systems like Module:Adjacent stations/Montreal Metro:
Can anyone spot what's going wrong? Thanks, BLAIXX 03:09, 24 October 2025 (UTC)
- @Blaixx: Aliases need to be in lower case, because inputs are lower-cased before comparing with aliases. Pi.1415926535 (talk) 04:14, 24 October 2025 (UTC)
- Many thanks! I should have read the doc page more carefully. BLAIXX 14:25, 24 October 2025 (UTC)