Difference between revisions of "Template:Amtrak web"

From blackwiki
Jump to navigation Jump to search
blackwiki>Daybeers
(removed excess brackets)
m (51 revisions imported)
 
(9 intermediate revisions by 2 users not shown)
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 {{{1|''{{PAGENAMEBASE}}''}}} – Amtrak]
+
     |Acela Express=[https://www.amtrak.com/routes/acela-express-train.html ''{{PAGENAMEBASE}}'' – Amtrak]
     |Lake Shore Limited=*[https://www.amtrak.com/routes/lake-shore-limited-train.html {{{1|''{{PAGENAMEBASE}}''}}} – Amtrak]
+
    |Amtrak Cascades=[https://www.amtrak.com/routes/cascades-train.html ''{{PAGENAMEBASE}}'' – Amtrak]
     |Sunset Limited=*[https://www.amtrak.com/routes/sunset-limited-train.html {{{1|''{{PAGENAMEBASE}}''}}} – Amtrak]
+
    |Auto Train=[https://www.amtrak.com/routes/auto-train.html ''{{PAGENAMEBASE}}'' – Amtrak]
     |Texas Eagle=*[https://www.amtrak.com/routes/texas-eagle-train.html {{{1|''{{PAGENAMEBASE}}''}}} – Amtrak]
+
    |Blue Water
     |#default=*[https://www.amtrak.com/routes/{{lc:{{PAGENAMEBASE}}}}-train.html {{{1|''{{PAGENAMEBASE}}''}}} – Amtrak]
+
    |Pere Marquette
 +
    |Wolverine=[https://www.amtrak.com/routes/michigan-services-train.html ''Michigan Services'' – Amtrak]
 +
    |California Zephyr=[https://www.amtrak.com/routes/california-zephyr-train.html ''{{PAGENAMEBASE}}'' – Amtrak]
 +
    |Capitol Corridor=[https://www.amtrak.com/routes/capitol-corridor-train.html ''{{PAGENAMEBASE}}'' – Amtrak]
 +
     |Capitol Limited=[https://www.amtrak.com/routes/capitol-limited-train.html ''{{PAGENAMEBASE}}'' – Amtrak]
 +
    |Carolinian
 +
    |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 ''{{PAGENAMEBASE}}'' – Amtrak]
 +
    |Coast Starlight=[https://www.amtrak.com/routes/coast-starlight-train.html ''{{PAGENAMEBASE}}'' – Amtrak]
 +
    |Empire Builder=[https://www.amtrak.com/routes/empire-builder-train.html ''{{PAGENAMEBASE}}'' – Amtrak]
 +
    |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 ''{{PAGENAMEBASE}}'' – Amtrak]
 +
    |Heartland Flyer=[https://www.amtrak.com/routes/heartland-flyer-train.html ''{{PAGENAMEBASE}}'' – Amtrak]
 +
    |Hiawatha Service=[https://www.amtrak.com/routes/hiawatha-train.html ''{{PAGENAMEBASE}}'' – Amtrak]
 +
    |Hoosier State=[https://www.amtrak.com/routes/hoosier-state-train.html ''{{PAGENAMEBASE}}'' – Amtrak]
 +
    |Illinois Zephyr and Carl Sandburg
 +
    |Illini and Saluki
 +
    |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 ''{{PAGENAMEBASE}}'' – Amtrak]
 +
     |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 ''{{PAGENAMEBASE}}'' – Amtrak]
 +
    |Missouri River Runner=[https://www.amtrak.com/routes/missouri-river-runner-train.html ''{{PAGENAMEBASE}}'' – Amtrak]
 +
    |New Haven–Springfield Shuttle
 +
    |Northeast Regional=[https://www.amtrak.com/routes/northeast-regional-train.html ''Northeast Regional'' – Amtrak]
 +
     |Pacific Surfliner=[https://www.amtrak.com/routes/pacific-surfliner-train.html ''{{PAGENAMEBASE}}'' – Amtrak]
 +
    |Palmetto
 +
    |Silver Meteor
 +
    |Silver Star=[https://www.amtrak.com/routes/silver-service-palmetto-train.html ''Silver Service / Palmetto'' – Amtrak]
 +
    |San Joaquin=[https://www.amtrak.com/routes/san-joaquins-train.html ''{{PAGENAMEBASE}}'' – Amtrak]
 +
    |Southwest Chief=[https://www.amtrak.com/routes/southwest-chief-train.html ''{{PAGENAMEBASE}}'' – Amtrak]
 +
    |Sunset Limited=[https://www.amtrak.com/routes/sunset-limited-train.html ''{{PAGENAMEBASE}}'' – Amtrak]
 +
    |Texas Eagle=[https://www.amtrak.com/routes/texas-eagle-train.html ''{{PAGENAMEBASE}}'' – Amtrak]
 +
    |#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]
 
}}<noinclude>
 
}}<noinclude>
 
{{documentation}}
 
{{documentation}}
 +
[[Category:Amtrak templates|web]]
 +
[[Category:External link templates]]
 
</noinclude>
 
</noinclude>

Latest revision as of 16:20, 20 October 2020

Template documentation[view] [edit] [history] [purge]

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.