Template talk:NJT 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)
This article is maintained by the Passenger trains task force.
Flag of New Jersey

This article is part of WikiProject New Jersey, an effort to create, expand, and improve New Jersey–related articles to Wikipedia feature-quality standard.

NA This page is not an article and does not require a rating on the quality scale.

Contents

[edit] Instructions

This template allows you to make a box at the bottom of a NJT station page listing the next and previous stations, including cases when the stations and/or terminals are of different agencies/types. It is designed in a way so that there is no need to actually put in any Wikilinks for the station names, only for the routes themselves. If you are putting square brackets for any parameter, you're not doing it right!

Parameters with a gray background are necessary only if their values differ from the type parameter. Parameters with a yellow background are normally pulled by default from {{NJT line color}}, {{NJT line pdir}}, {{NJT line ndir}}, and {{NJT line ndir2}} and only need to be specified if they are not defined in those templates (which should be never). The type parameter is also optional (defaults to NJT in that case). Technically, the only mandatory param is the line name, in which case you'll have a box with Terminus for both next and previous stations.

Param name Meaning What to enter
type Type of station
that is, for the station on which the template is going
Currently there are 5 accepted types and each has a few ways to be called.

NCS and ncs for Newark City Subway
NLR and nlr for Newark Light Rail
river for River Line
HBLR and hblr Hudson-Bergen Light Rail
MNRR, mnrr, and metro for Metro-North Railroad
Any other value, including not specifying this parameter at all or leaving it blank for all other NJT stations

previous "Previous" station Enter the station's name only. If left blank, Terminus will be displayed (at end stations).
ptype "Previous" station type Same as for type
pdir Direction of "previous" station listed above Enter the name of the terminus station in the direction that the station above is listed. For example, High Bridge for the Raritan Valley line going west.
pdtype "Previous" direction station type Same as for type
line Rail line name Enter the rail line name as follows:

Northeast Corridor or nec for Northeast Corridor Line
North Jersey Coast or njcl for North Jersey Coast Line
Montclair-Boonton or m-b for Montclair-Boonton Line
Morristown or mtown for Morristown Line
Gladstone or g for Gladstone Branch
Pascack Valley or pvl for Pascack Valley Line
Main or main for Main Line
Bergen County or bergen for Bergen County Line
Atlantic City or acl for Atlantic City Line
Raritan Valley or rvl for Raritan Valley Line
Newark City Subway Broad or ncsb or Newark Light Rail or nlr for Newark Light Rail
Newark City Subway or ncs for Newark City Subway
West Side–Tonnelle or West Side-Tonnelle for West Side-Tonnelle
Hoboken–Tonnelle or Hoboken-Tonnelle for Hoboken-Tonnelle
22nd Street–Hoboken or 22nd Street-Hoboken for 22nd Street-Hoboken
River Line or River line or river for River Line

next "Next" station Enter the station's name only. If left blank, Terminus will be displayed (at end stations).
ntype "Next" station type Same as for type
ndir Direction of "next" station listed above Enter the name of the terminus station in the direction that the station above is listed. For example, Hoboken for the Raritan Valley line going east.
ndtype "Next" direction station type Same as for type
col Line color Enter a hex value for the line's color, to be used for the colored bars on either side of the line name

[edit] Suggestions

[edit] Esoteric

{{{can}}}{{{anyone}}}{{{make}}}{{{sense}}}{{{of}}}{{{this}}}{{{tempate}}}[[?]]?? --ChrisRuvolo (t) 02:20, 7 July 2006 (UTC)

lol, actually, it's not that bad. there's currently a bunch of other templates floating around, linked to the line names. There is a group of templates for the line colors, and another for their article titles/links. What needs to happen is we get one template for both, which just uses a single switch statement. shouldn't be hard to whip up tomorrow. ciao. lensovet 07:09, 22 July 2006 (UTC)
done. let me know if it makes more sense now. lensovet 02:41, 23 July 2006 (UTC)

[edit] Hard-code station links?

Can this template be changed so that links to previous and next stations can be hand coded instead of being automatically formatted as "Foo (NJT station)"? (For example, "[[Pennsylvania Station (Newark)|Newark Penn Station]]" -> Newark Penn Station instead of "Newark Penn" -> [[Newark Penn (NJT station)|Newark Penn]] -> Newark Penn.) I would do it myself, but I'm not sufficiently familiar with the markup to be confident about not breaking something. --CComMack (t•c) 20:21, 22 July 2006 (UTC)

You can do this - just type the station name as you wish it to be, then click on the non-existent link, and convert the page to a redirect. lensovet 23:00, 22 July 2006 (UTC)
That is possible, but that is, if you will excuse me, an ugly hack, and really on the edge of proper use of redirects. It isn't as though typing out your own links is so onerous; I'm perfectly willing to edit the existing instatiations of this template myself so that they all still work after the changeover. --CComMack (t•c) 23:46, 22 July 2006 (UTC)
Agreed, but the whole point of this template was so that you didn't need to use piped links, and here you come along, wanting to do it ;). Honestly though, I don't think this is really doable. Essentially you'd have to do some sort of regexp check to see if the station title starts with [[ and then place it into the table "as is". I'll be honest up front, I don't know if this is even doable within the wiki software, much less figure out how to do it...maybe someone else can though. lensovet 23:57, 22 July 2006 (UTC)
Why do you need a regexp check? If the link is malformed (or there is no link), that's something that can be fixed through the normal wiki editing process. As to using the links "as is", that's how similar templates for Amtrak and SEPTA lines work, as well as the original succession box template. It's, if anything, much simpler code. --CComMack (t•c) 00:15, 23 July 2006 (UTC)
no no no...i mean come on, the thing you're talking about involves, at most, 3 stations? on all the other stations, writing Station name (XXX station)|Station name, is, to put it bluntly, a pain in the ass. I'm totally serious too. The whole point of the template is that the piped link is created automatically, the station type is done automatically, etc. That's why it's called NJT line and not "rail line", which is the original template that this was created from. And also, what do you mean by If the link is malformed (or there is no link), that's something that can be fixed through the normal wiki editing process. lensovet 01:52, 23 July 2006 (UTC)
though there is a somewhat simple solution – introduce the parameter auto, which if set to no (i.e. {{NJT line|auto=no|...}}) would not auto-formulate station links. but to be honest, this is not really desirable. the whole point of the template is to keep wiki markup as much as possible out of the template parameters. lensovet 01:57, 23 July 2006 (UTC)
Why the hate (or fear) of wiki markup? It's simple, transparent, easy to learn, and powerful enough to do anything that we need to ask of it. If there's a problem, any editor can fix it. I don't understand why you're so against making this template work just like the entire rest of the wiki. If you're afraid of the changeover costs, remember that it's a one-time cost, and that editor time is cheap (free in your case, because I'm volunteering to do the repetitive tasks.) --CComMack (t•c) 20:24, 24 July 2006 (UTC)
I don't hate or fear it, I just think that it should generally be avoided in templates. This prevents errors and guarantees consistency. ... like I said, if you want, we can add a "manual" switch to it. —lensovettalk – 20:46, 24 July 2006 (UTC)