Difference between revisions of "Template:Amtrak web"
blackwiki>Daybeers (added rest of routes, will change the articles later) |
blackwiki>Daybeers (removed unneeded code and changed a few displays) |
||
| Line 1: | Line 1: | ||
{{#switch:{{{route}}} | {{#switch:{{{route}}} | ||
|yes={{#switch:{{PAGENAMEBASE}} | |yes={{#switch:{{PAGENAMEBASE}} | ||
| − | |Acela Express=*[https://www.amtrak.com/routes/acela-express-train.html | + | |Acela Express=*[https://www.amtrak.com/routes/acela-express-train.html ''{{PAGENAMEBASE}}'' – Amtrak] |
| − | |Amtrak Cascades=*[https://www.amtrak.com/routes/cascades-train.html | + | |Amtrak Cascades=*[https://www.amtrak.com/routes/cascades-train.html ''{{PAGENAMEBASE}}'' – Amtrak] |
| − | |Auto Train=*[https://www.amtrak.com/routes/auto-train.html | + | |Auto Train=*[https://www.amtrak.com/routes/auto-train.html ''{{PAGENAMEBASE}}'' – Amtrak] |
|Blue Water | |Blue Water | ||
|Pere Marquette | |Pere Marquette | ||
| − | |Wolverine=*[https://www.amtrak.com/routes/michigan-services-train.html | + | |Wolverine=*[https://www.amtrak.com/routes/michigan-services-train.html ''Michigan Services'' – Amtrak] |
| − | |California Zephyr=*[https://www.amtrak.com/routes/california-zephyr-train.html | + | |California Zephyr=*[https://www.amtrak.com/routes/california-zephyr-train.html ''{{PAGENAMEBASE}}'' – Amtrak] |
| − | |Capitol Corridor=*[https://www.amtrak.com/routes/capitol-corridor-train.html | + | |Capitol Corridor=*[https://www.amtrak.com/routes/capitol-corridor-train.html ''{{PAGENAMEBASE}}'' – Amtrak] |
| − | |Capitol Limited=*[https://www.amtrak.com/routes/capitol-limited-train.html | + | |Capitol Limited=*[https://www.amtrak.com/routes/capitol-limited-train.html ''{{PAGENAMEBASE}}'' – Amtrak] |
|Carolinian | |Carolinian | ||
| − | |Piedmont=*[https://www.amtrak.com/routes/carolinian-piedmont-train.html | + | |Piedmont=*[https://www.amtrak.com/routes/carolinian-piedmont-train.html ''Carolinian & Piedmont'' – Amtrak] |
| − | |City of New Orleans=*[https://www.amtrak.com/routes/city-of-new-orleans-train.html | + | |City of New Orleans=*[https://www.amtrak.com/routes/city-of-new-orleans-train.html ''{{PAGENAMEBASE}}'' – Amtrak] |
| − | |Coast Starlight=*[https://www.amtrak.com/routes/coast-starlight-train.html | + | |Coast Starlight=*[https://www.amtrak.com/routes/coast-starlight-train.html ''{{PAGENAMEBASE}}'' – Amtrak] |
| − | |Empire Builder=*[https://www.amtrak.com/routes/empire-builder-train.html | + | |Empire Builder=*[https://www.amtrak.com/routes/empire-builder-train.html ''{{PAGENAMEBASE}}'' – Amtrak] |
| − | |Empire Service=*[https://www.amtrak.com/routes/empire-service-train.html | + | |Empire Service=*[https://www.amtrak.com/routes/empire-service-train.html ''{{PAGENAMEBASE}}'' – Amtrak] |
| − | |Ethan Allen Express=*[https://www.amtrak.com/routes/ethan-allen-express-train.html | + | |Ethan Allen Express=*[https://www.amtrak.com/routes/ethan-allen-express-train.html ''{{PAGENAMEBASE}}'' – Amtrak] |
| − | |Heartland Flyer=*[https://www.amtrak.com/routes/heartland-flyer-train.html | + | |Heartland Flyer=*[https://www.amtrak.com/routes/heartland-flyer-train.html ''{{PAGENAMEBASE}}'' – Amtrak] |
| − | |Hoosier State=*[https://www.amtrak.com/routes/hoosier-state-train.html | + | |Hoosier State=*[https://www.amtrak.com/routes/hoosier-state-train.html ''{{PAGENAMEBASE}}'' – Amtrak] |
|Illinois Zephyr and Carl Sandburg | |Illinois Zephyr and Carl Sandburg | ||
|Illini and Saluki | |Illini and Saluki | ||
| − | |Lincoln Service=*[https://www.amtrak.com/routes/illinois-services-train.html | + | |Lincoln Service=*[https://www.amtrak.com/routes/illinois-services-train.html ''Illinois Services'' – Amtrak] |
| − | |Keystone Service=*[https://www.amtrak.com/routes/keystone-service-train.html | + | |Keystone Service=*[https://www.amtrak.com/routes/keystone-service-train.html ''{{PAGENAMEBASE}}'' – Amtrak] |
| − | |Lake Shore Limited=*[https://www.amtrak.com/routes/lake-shore-limited-train.html | + | |Lake Shore Limited=*[https://www.amtrak.com/routes/lake-shore-limited-train.html ''{{PAGENAMEBASE}}'' – Amtrak] |
| − | |Maple Leaf=*[https://www.amtrak.com/routes/maple-leaf-train.html | + | |Maple Leaf=*[https://www.amtrak.com/routes/maple-leaf-train.html ''{{PAGENAMEBASE}}'' – Amtrak] |
| − | |Missouri River Runner=*[https://www.amtrak.com/routes/missouri-river-runner-train.html | + | |Missouri River Runner=*[https://www.amtrak.com/routes/missouri-river-runner-train.html ''{{PAGENAMEBASE}}'' – Amtrak] |
| − | |Northeast Regional=*[https://www.amtrak.com/routes/northeast-regional-train.html | + | |Northeast Regional=*[https://www.amtrak.com/routes/northeast-regional-train.html ''{{PAGENAMEBASE}}'' – Amtrak] |
| − | |Pacific Surfliner=*[https://www.amtrak.com/routes/pacific-surfliner-train.html | + | |Pacific Surfliner=*[https://www.amtrak.com/routes/pacific-surfliner-train.html ''{{PAGENAMEBASE}}'' – Amtrak] |
|Palmetto | |Palmetto | ||
|Silver Meteor | |Silver Meteor | ||
| − | |Silver Star=*[https://www.amtrak.com/routes/silver-service-palmetto-train.html | + | |Silver Star=*[https://www.amtrak.com/routes/silver-service-palmetto-train.html ''Silver Service/Palmetto'' – Amtrak] |
| − | |San Joaquins=*[https://www.amtrak.com/routes/san-joaquins-train.html | + | |San Joaquins=*[https://www.amtrak.com/routes/san-joaquins-train.html ''{{PAGENAMEBASE}}'' – Amtrak] |
| − | |Southwest Chief=*[https://www.amtrak.com/routes/southwest-chief-train.html | + | |Southwest Chief=*[https://www.amtrak.com/routes/southwest-chief-train.html ''{{PAGENAMEBASE}}'' – Amtrak] |
| − | |Sunset Limited=*[https://www.amtrak.com/routes/sunset-limited-train.html | + | |Sunset Limited=*[https://www.amtrak.com/routes/sunset-limited-train.html ''{{PAGENAMEBASE}}'' – Amtrak] |
| − | |Texas Eagle=*[https://www.amtrak.com/routes/texas-eagle-train.html | + | |Texas Eagle=*[https://www.amtrak.com/routes/texas-eagle-train.html ''{{PAGENAMEBASE}}'' – Amtrak] |
| − | |#default=*[https://www.amtrak.com/routes/{{lc:{{PAGENAMEBASE}}}}-train.html | + | |#default=*[https://www.amtrak.com/routes/{{lc:{{PAGENAMEBASE}}}}-train.html ''{{PAGENAMEBASE}}'' – Amtrak] |
}} | }} | ||
|#default=*[https://www.amtrak.com/stations/{{lc:{{{1}}}}} {{{2|{{remove last word|{{PAGENAMEBASE}}}}}}} – Amtrak] | |#default=*[https://www.amtrak.com/stations/{{lc:{{{1}}}}} {{{2|{{remove last word|{{PAGENAMEBASE}}}}}}} – Amtrak] | ||
Revision as of 02:29, 30 November 2018
- Template:Remove last word – Amtrak
Usage
This template provides a simple way to link to the official Amtrak station and route pages. The default usage is for stations, with the first unnamed parameter being the station code, ex. PVD for Template:Station link. The template uses this to create the link to the Amtrak page, in this case https://www.amtrak.com/stations/pvd. Case doesn't matter for this, as the template automatically converts the value to lowercase. In order to get the template to display in a "city/town, state" format, a second parameter needs to be defined with the text to display. For example, {{amtrak web|PVD|Providence, RI}} displays Providence, RI – Amtrak. Otherwise, the template will take the base of the article title (meaning without any disambiguation) and remove the last word, normally "station", and then display the output. For example, {{amtrak web|PVD}} displays Providence – Amtrak. What to display for oddballs like Union Stations is at the discretion of the editors of that particular page.
The route parameter allows this template to also be used for route pages, ex. https://www.amtrak.com/routes/california-zephyr-train.html. The only value for this parameter is yes. For example, putting {{amtrak web|route=yes}} on the California Zephyr page displays California Zephyr – Amtrak.
| The above documentation is transcluded from Template:Amtrak web/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |